aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVincent Malley <vincent.malley@insalien.org>2015-06-02 11:09:28 -0400
committerVincent Malley <vincent.malley@insalien.org>2015-06-02 11:09:28 -0400
commitf9c8087f787b6ac38ca2c3b6a876a803860b8991 (patch)
tree4a119b976d0bcf4145c01774a37e05e933523848
parent727c35d8096c7690f66f2a815af3e8cabae00399 (diff)
downloadwallabag-f9c8087f787b6ac38ca2c3b6a876a803860b8991.tar.gz
wallabag-f9c8087f787b6ac38ca2c3b6a876a803860b8991.tar.zst
wallabag-f9c8087f787b6ac38ca2c3b6a876a803860b8991.zip
[1203] fixing tag export
-rwxr-xr-xinc/poche/Database.class.php15
-rwxr-xr-xinc/poche/Poche.class.php2
2 files changed, 16 insertions, 1 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 465d9f95..d297807a 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -874,7 +874,7 @@ class Poche
874 $filename = "wallabag-export-".$this->user->getId()."-".date("Y-m-d").".json"; 874 $filename = "wallabag-export-".$this->user->getId()."-".date("Y-m-d").".json";
875 header('Content-Disposition: attachment; filename='.$filename); 875 header('Content-Disposition: attachment; filename='.$filename);
876 876
877 $entries = $this->store->retrieveAll($this->user->getId()); 877 $entries = $this->store->retrieveAllWithTags($this->user->getId());
878 echo $this->tpl->render('export.twig', array( 878 echo $this->tpl->render('export.twig', array(
879 'export' => Tools::renderJson($entries), 879 'export' => Tools::renderJson($entries),
880 )); 880 ));