mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-22 06:38:08 +00:00
Merge pull request #1207 from vpmalley/dev
issue #1203: fixing tag export
This commit is contained in:
commit
c56d1f21e3
2 changed files with 17 additions and 2 deletions
|
@ -323,6 +323,21 @@ class Database {
|
|||
return $entries;
|
||||
}
|
||||
|
||||
public function retrieveAllWithTags($user_id)
|
||||
{
|
||||
$entries = $this->retrieveAll($user_id);
|
||||
$count = count($entries);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$tag_entries = $this->retrieveTagsByEntry($entries[$i]['id']);
|
||||
$tags = [];
|
||||
foreach ($tag_entries as $tag) {
|
||||
$tags[] = $tag[1];
|
||||
}
|
||||
$entries[$i]['tags'] = implode(',', $tags);
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
|
||||
public function retrieveOneById($id, $user_id)
|
||||
{
|
||||
$entry = NULL;
|
||||
|
|
|
@ -278,7 +278,7 @@ class Poche
|
|||
}
|
||||
Tools::logm($msg);
|
||||
}
|
||||
Tools::redirect('?');
|
||||
Tools::redirect();
|
||||
break;
|
||||
case 'toggle_fav' :
|
||||
$this->store->favoriteById($id, $this->user->getId());
|
||||
|
@ -896,7 +896,7 @@ class Poche
|
|||
$filename = "wallabag-export-".$this->user->getId()."-".date("Y-m-d").".json";
|
||||
header('Content-Disposition: attachment; filename='.$filename);
|
||||
|
||||
$entries = $this->store->retrieveAll($this->user->getId());
|
||||
$entries = $this->store->retrieveAllWithTags($this->user->getId());
|
||||
echo $this->tpl->render('export.twig', array(
|
||||
'export' => Tools::renderJson($entries),
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue