aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/export/articles.phtml
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-12-22 13:22:20 +0100
committerGravatar GitHub <noreply@github.com> 2018-12-22 13:22:20 +0100
commitf0a359619fa2936d66a2b96dd086d4686e7405fa (patch)
treeddad42a7f6813bd458f39d5203d083daad4cc1c5 /app/views/helpers/export/articles.phtml
parente04804d0f67dd43fd3f072b9a127768ee7b7b56c (diff)
parent4a1a852f457d52fa47191e3f7e3e9073e1324cd9 (diff)
Merge pull request #2186 from FreshRSS/dev1.13.0
FreshRSS 1.13.0
Diffstat (limited to 'app/views/helpers/export/articles.phtml')
-rw-r--r--app/views/helpers/export/articles.phtml18
1 files changed, 16 insertions, 2 deletions
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index b8958f527..59a2c7ad7 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -16,6 +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();
+}
+
foreach ($this->entriesRaw as $entryRaw) {
if (empty($entryRaw)) {
continue;
@@ -32,13 +38,14 @@ foreach ($this->entriesRaw as $entryRaw) {
$article = array(
'id' => $entry->guid(),
+ 'timestampUsec' => '' . $entry->id(),
'categories' => array_values($entry->tags()),
'title' => $entry->title(),
- 'author' => $entry->authors(true), //TODO: Make an array like tags?
+ 'author' => $entry->authors(true),
'published' => $entry->date(true),
'updated' => $entry->date(true),
'alternate' => array(array(
- 'href' => $entry->link(),
+ 'href' => htmlspecialchars_decode($entry->link(), ENT_QUOTES),
'type' => 'text/html',
)),
'content' => array(
@@ -51,6 +58,13 @@ foreach ($this->entriesRaw as $entryRaw) {
'feedUrl' => $feed == null ? '' : $feed->url(),
)
);
+ if ($entry->isFavorite()) {
+ $article['categories'][] = 'user/-/state/com.google/starred';
+ }
+ $tagNames = isset($entryIdsTagNames['e_' . $entry->id()]) ? $entryIdsTagNames['e_' . $entry->id()] : array();
+ foreach ($tagNames as $tagName) {
+ $article['categories'][] = 'user/-/label/' . $tagName;
+ }
$line = json_encode($article, $options);
if ($line != '') {