1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

[add] create tags page

This commit is contained in:
Nicolas Lœuillet 2013-12-06 13:15:06 +01:00
parent 68e2061666
commit 2e2ebe5ec7
5 changed files with 29 additions and 5 deletions

View file

@ -250,13 +250,21 @@ class Database {
return $this->getHandle()->lastInsertId($column);
}
public function retrieveAllTags() {
$sql = "SELECT * FROM tags";
$query = $this->executeQuery($sql, array());
$tags = $query->fetchAll();
return $tags;
}
public function retrieveTagsByEntry($entry_id) {
$sql =
$sql =
"SELECT * FROM tags
LEFT JOIN tags_entries ON tags_entries.tag_id=tags.id
WHERE tags_entries.entry_id = ?";
$query = $this->executeQuery($sql, array($entry_id));
$tags = $query->fetchAll();
$query = $this->executeQuery($sql, array($entry_id));
$tags = $query->fetchAll();
return $tags;
}

View file

@ -430,6 +430,12 @@ class Poche
);
Tools::logm('config view');
break;
case 'tags':
$tags = $this->store->retrieveAllTags();
$tpl_vars = array(
'tags' => $tags,
);
break;
case 'view':
$entry = $this->store->retrieveOneById($id, $this->user->getId());
if ($entry != NULL) {

View file

@ -103,14 +103,15 @@ class Tools
case 'config':
$tpl_file = 'config.twig';
break;
case 'tags':
$tpl_file = 'tags.twig';
break;
case 'view':
$tpl_file = 'view.twig';
break;
case 'login':
$tpl_file = 'login.twig';
break;
case 'error':
$tpl_file = 'error.twig';
break;