aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinc/poche/Database.class.php15
-rwxr-xr-xinc/poche/Poche.class.php4
2 files changed, 17 insertions, 2 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 1a88d7d9..7be7a394 100755
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -323,6 +323,21 @@ class Database {
323 return $entries; 323 return $entries;
324 } 324 }
325 325
326 public function retrieveAllWithTags($user_id)
327 {
328 $entries = $this->retrieveAll($user_id);
329 $count = count($entries);
330 for ($i = 0; $i < $count; $i++) {
331 $tag_entries = $this->retrieveTagsByEntry($entries[$i]['id']);
332 $tags = [];
333 foreach ($tag_entries as $tag) {
334 $tags[] = $tag[1];
335 }
336 $entries[$i]['tags'] = implode(',', $tags);
337 }
338 return $entries;
339 }
340
326 public function retrieveOneById($id, $user_id) 341 public function retrieveOneById($id, $user_id)
327 { 342 {
328 $entry = NULL; 343 $entry = NULL;
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 4fb028ff..779c04c2 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -278,7 +278,7 @@ class Poche
278 } 278 }
279 Tools::logm($msg); 279 Tools::logm($msg);
280 } 280 }
281 Tools::redirect('?'); 281 Tools::redirect();
282 break; 282 break;
283 case 'toggle_fav' : 283 case 'toggle_fav' :
284 $this->store->favoriteById($id, $this->user->getId()); 284 $this->store->favoriteById($id, $this->user->getId());
@@ -896,7 +896,7 @@ class Poche
896 $filename = "wallabag-export-".$this->user->getId()."-".date("Y-m-d").".json"; 896 $filename = "wallabag-export-".$this->user->getId()."-".date("Y-m-d").".json";
897 header('Content-Disposition: attachment; filename='.$filename); 897 header('Content-Disposition: attachment; filename='.$filename);
898 898
899 $entries = $this->store->retrieveAll($this->user->getId()); 899 $entries = $this->store->retrieveAllWithTags($this->user->getId());
900 echo $this->tpl->render('export.twig', array( 900 echo $this->tpl->render('export.twig', array(
901 'export' => Tools::renderJson($entries), 901 'export' => Tools::renderJson($entries),
902 )); 902 ));