aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/EntriesExport.php
diff options
context:
space:
mode:
authorÉtienne Gilli <etienne.gilli@gmail.com>2017-07-09 18:33:14 +0200
committerÉtienne Gilli <etienne.gilli@gmail.com>2017-07-09 18:33:14 +0200
commitc57f69d967dea05e507e997193a783fed991de8e (patch)
treef12ac961b36d8329a4934efe6d1e8bd090d9da57 /src/Wallabag/CoreBundle/Helper/EntriesExport.php
parent07320a2bd25c6ace1f9b1aa06b1b08e8dbf4f4fa (diff)
downloadwallabag-c57f69d967dea05e507e997193a783fed991de8e.tar.gz
wallabag-c57f69d967dea05e507e997193a783fed991de8e.tar.zst
wallabag-c57f69d967dea05e507e997193a783fed991de8e.zip
Use the article publisher as author for export
When exporting an entry, use the publishedBy field as author name for epub, mobi and pdf formats. Fallback to domain name if empty.
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/EntriesExport.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index d749dcf9..e16168b1 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -73,7 +73,9 @@ class EntriesExport
73 } 73 }
74 74
75 /** 75 /**
76 * Sets the author for just one entry. 76 * Sets the author for one entry or category.
77 *
78 * The publishers are used, or the domain name if empty.
77 * 79 *
78 * @param string $method Method to get articles 80 * @param string $method Method to get articles
79 * 81 *
@@ -84,7 +86,12 @@ class EntriesExport
84 $this->author = $method.' authors'; 86 $this->author = $method.' authors';
85 87
86 if ('entry' === $method) { 88 if ('entry' === $method) {
87 $this->author = $this->entries[0]->getDomainName(); 89 $publishedBy = $this->entries[0]->getPublishedBy();
90 if (!empty($publishedBy)) {
91 $this->author = implode(', ', $this->entries[0]->getPublishedBy());
92 } else {
93 $this->author = $this->entries[0]->getDomainName();
94 }
88 } 95 }
89 96
90 return $this; 97 return $this;