diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2019-01-06 20:17:35 +0100 |
---|---|---|
committer | Kevin Decherf <kevin@kdecherf.com> | 2019-01-07 21:44:14 +0100 |
commit | f8108346236e18768c08d6c0d4dc5fb4dfe13b78 (patch) | |
tree | 01bcdba72843de45788e0ace43ddf1133ec6412d /src/Wallabag/CoreBundle | |
parent | 30cf72bf55cdb2130e9096b1f7bcfa2f2ea1df1c (diff) | |
download | wallabag-f8108346236e18768c08d6c0d4dc5fb4dfe13b78.tar.gz wallabag-f8108346236e18768c08d6c0d4dc5fb4dfe13b78.tar.zst wallabag-f8108346236e18768c08d6c0d4dc5fb4dfe13b78.zip |
EntriesExport: change authors and title when not single entry export
Change '{method} authors' (which gives 'Tag_entries authors' when
exporting a tag) to 'Various authors'.
When exporting a tag (tag_entries), change the title from 'Tag_entries
articles' to 'Tag {tag} articles'.
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ExportController.php | 5 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/EntriesExport.php | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 7ca89239..9e9dbe49 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php | |||
@@ -58,6 +58,7 @@ class ExportController extends Controller | |||
58 | $method = ucfirst($category); | 58 | $method = ucfirst($category); |
59 | $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; | 59 | $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; |
60 | $repository = $this->get('wallabag_core.entry_repository'); | 60 | $repository = $this->get('wallabag_core.entry_repository'); |
61 | $title = $method; | ||
61 | 62 | ||
62 | if ('tag_entries' === $category) { | 63 | if ('tag_entries' === $category) { |
63 | $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); | 64 | $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); |
@@ -66,6 +67,8 @@ class ExportController extends Controller | |||
66 | $this->getUser()->getId(), | 67 | $this->getUser()->getId(), |
67 | $tag->getId() | 68 | $tag->getId() |
68 | ); | 69 | ); |
70 | |||
71 | $title = 'Tag ' . $tag->getLabel(); | ||
69 | } else { | 72 | } else { |
70 | $entries = $repository | 73 | $entries = $repository |
71 | ->$methodBuilder($this->getUser()->getId()) | 74 | ->$methodBuilder($this->getUser()->getId()) |
@@ -76,7 +79,7 @@ class ExportController extends Controller | |||
76 | try { | 79 | try { |
77 | return $this->get('wallabag_core.helper.entries_export') | 80 | return $this->get('wallabag_core.helper.entries_export') |
78 | ->setEntries($entries) | 81 | ->setEntries($entries) |
79 | ->updateTitle($method) | 82 | ->updateTitle($title) |
80 | ->updateAuthor($method) | 83 | ->updateAuthor($method) |
81 | ->exportAs($format); | 84 | ->exportAs($format); |
82 | } catch (\InvalidArgumentException $e) { | 85 | } catch (\InvalidArgumentException $e) { |
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 92f1779c..db5340fc 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php | |||
@@ -85,7 +85,7 @@ class EntriesExport | |||
85 | public function updateAuthor($method) | 85 | public function updateAuthor($method) |
86 | { | 86 | { |
87 | if ('entry' !== $method) { | 87 | if ('entry' !== $method) { |
88 | $this->author = $method . ' authors'; | 88 | $this->author = 'Various authors'; |
89 | 89 | ||
90 | return $this; | 90 | return $this; |
91 | } | 91 | } |