aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rwxr-xr-xinc/poche/Poche.class.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 99d2989b..bce7d651 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -1143,27 +1143,32 @@ class Poche
1143 $entry = $this->store->retrieveOneById($entryID, $this->user->getId()); 1143 $entry = $this->store->retrieveOneById($entryID, $this->user->getId());
1144 $entries = array($entry); 1144 $entries = array($entry);
1145 $bookTitle = $entry['title']; 1145 $bookTitle = $entry['title'];
1146 $bookFileName = substr($bookTitle, 0, 200);
1146 break; 1147 break;
1147 case 'all': 1148 case 'all':
1148 $entries = $this->store->retrieveAll($this->user->getId()); 1149 $entries = $this->store->retrieveAll($this->user->getId());
1149 $bookTitle = _('All my articles'); 1150 $bookTitle = sprintf(_('All my articles on '), date(_('d.m.y'))); #translatable because each country has it's own date format system
1151 $bookFileName = _('Allarticles') . date(_('dmY'));
1150 break; 1152 break;
1151 case 'tag': 1153 case 'tag':
1152 $tag = filter_var($_GET['tag'],FILTER_SANITIZE_STRING); 1154 $tag = filter_var($_GET['tag'],FILTER_SANITIZE_STRING);
1153 $tags_id = $this->store->retrieveAllTags($this->user->getId(),$tag); 1155 $tags_id = $this->store->retrieveAllTags($this->user->getId(),$tag);
1154 $tag_id = $tags_id[0]["id"]; // we take the first result, which is supposed to match perfectly. There must be a workaround. 1156 $tag_id = $tags_id[0]["id"]; // we take the first result, which is supposed to match perfectly. There must be a workaround.
1155 $entries = $this->store->retrieveEntriesByTag($tag_id,$this->user->getId()); 1157 $entries = $this->store->retrieveEntriesByTag($tag_id,$this->user->getId());
1156 $bookTitle = sprintf(_('Articles related to %s'),$tag); 1158 $bookTitle = sprintf(_('Articles tagged %s'),$tag);
1159 $bookFileName = substr(sprintf(_('Tag %s'),$tag), 0, 200);
1157 break; 1160 break;
1158 case 'category': 1161 case 'category':
1159 $category = filter_var($_GET['category'],FILTER_SANITIZE_STRING); 1162 $category = filter_var($_GET['category'],FILTER_SANITIZE_STRING);
1160 $entries = $this->store->getEntriesByView($category,$this->user->getId()); 1163 $entries = $this->store->getEntriesByView($category,$this->user->getId());
1161 $bookTitle = sprintf(_('All my articles in category %s'), $category); 1164 $bookTitle = sprintf(_('All articles in category %s'), $category);
1165 $bookFileName = substr(sprintf(_('Category %s'),$category), 0, 200);
1162 break; 1166 break;
1163 case 'search': 1167 case 'search':
1164 $search = filter_var($_GET['search'],FILTER_SANITIZE_STRING); 1168 $search = filter_var($_GET['search'],FILTER_SANITIZE_STRING);
1165 $entries = $this->store->search($search,$this->user->getId()); 1169 $entries = $this->store->search($search,$this->user->getId());
1166 $bookTitle = sprintf(_('All my articles for search %s'), $search); 1170 $bookTitle = sprintf(_('All articles for search %s'), $search);
1171 $bookFileName = substr(sprintf(_('Search %s'), $search), 0, 200);
1167 break; 1172 break;
1168 case 'default': 1173 case 'default':
1169 die(_('Uh, there is a problem while generating epub.')); 1174 die(_('Uh, there is a problem while generating epub.'));
@@ -1241,6 +1246,6 @@ class Poche
1241 //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n</pre>" . $bookEnd); 1246 //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n</pre>" . $bookEnd);
1242 } 1247 }
1243 $book->finalize(); 1248 $book->finalize();
1244 $zipData = $book->sendBook(_('wallabag\'s articles')); 1249 $zipData = $book->sendBook($bookFileName);
1245 } 1250 }
1246} 1251}