From 743c1b740bd8ec0b70f7058d4b52101b346a5e9c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 16 Jan 2019 22:26:43 +0100 Subject: Export labels (#2217) * Export labels https://github.com/FreshRSS/FreshRSS/issues/2196 * Small fixes * Backport code from 1.14.0 https://github.com/FreshRSS/FreshRSS/pull/2199/commits/4888f919f104b2d170302565e481a0b731eb4145 * More fixes --- app/views/helpers/export/articles.phtml | 10 ++++------ app/views/importExport/index.phtml | 5 +++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml index 59a2c7ad7..eb2cb0924 100644 --- a/app/views/helpers/export/articles.phtml +++ b/app/views/helpers/export/articles.phtml @@ -16,14 +16,12 @@ $articles = array( echo rtrim(json_encode($articles, $options), " ]}\n\r\t"), "\n"; $first = true; -$tagDAO = FreshRSS_Factory::createTagDao(); -$entryIdsTagNames = $tagDAO->getEntryIdsTagNames($this->entriesRaw); -if ($entryIdsTagNames == false) { - $entryIdsTagNames = array(); +if (empty($this->entryIdsTagNames)) { + $this->entryIdsTagNames = array(); } foreach ($this->entriesRaw as $entryRaw) { - if (empty($entryRaw)) { + if ($entryRaw == null) { continue; } $entry = FreshRSS_EntryDAO::daoToEntry($entryRaw); @@ -61,7 +59,7 @@ foreach ($this->entriesRaw as $entryRaw) { if ($entry->isFavorite()) { $article['categories'][] = 'user/-/state/com.google/starred'; } - $tagNames = isset($entryIdsTagNames['e_' . $entry->id()]) ? $entryIdsTagNames['e_' . $entry->id()] : array(); + $tagNames = isset($this->entryIdsTagNames['e_' . $entry->id()]) ? $this->entryIdsTagNames['e_' . $entry->id()] : array(); foreach ($tagNames as $tagName) { $article['categories'][] = 'user/-/label/' . $tagName; } diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index c5049e3ea..139e715c5 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -33,6 +33,11 @@ + +