aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-12 21:52:01 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-12 21:52:01 +0100
commitf14807de06929486de6e2b64cd30e5c53978d8c0 (patch)
treeb42557587671806e22666336f1a346914ae43aac
parented2853564e3db719abf5378b31fe5067dad513c4 (diff)
downloadwallabag-f14807de06929486de6e2b64cd30e5c53978d8c0.tar.gz
wallabag-f14807de06929486de6e2b64cd30e5c53978d8c0.tar.zst
wallabag-f14807de06929486de6e2b64cd30e5c53978d8c0.zip
[add] mark all as read #385
-rw-r--r--inc/poche/Database.class.php6
-rw-r--r--inc/poche/Poche.class.php7
2 files changed, 13 insertions, 0 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php
index 0457af69..9f553fa1 100644
--- a/inc/poche/Database.class.php
+++ b/inc/poche/Database.class.php
@@ -318,6 +318,12 @@ class Database {
318 $query = $this->executeQuery($sql_action, $params_action); 318 $query = $this->executeQuery($sql_action, $params_action);
319 } 319 }
320 320
321 public function archiveAll($user_id) {
322 $sql_action = "UPDATE entries SET is_read=? WHERE user_id=? AND is_read=?";
323 $params_action = array($user_id, 1, 0);
324 $query = $this->executeQuery($sql_action, $params_action);
325 }
326
321 public function getLastId($column = '') { 327 public function getLastId($column = '') {
322 return $this->getHandle()->lastInsertId($column); 328 return $this->getHandle()->lastInsertId($column);
323 } 329 }
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 9345d1c1..a786c8df 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -434,6 +434,13 @@ class Poche
434 Tools::redirect(); 434 Tools::redirect();
435 } 435 }
436 break; 436 break;
437 case 'archive_all' :
438 $this->store->archiveAll($this->user->getId());
439 Tools::logm('archive all links');
440 if (!$import) {
441 Tools::redirect();
442 }
443 break;
437 case 'add_tag' : 444 case 'add_tag' :
438 $tags = explode(',', $_POST['value']); 445 $tags = explode(',', $_POST['value']);
439 $entry_id = $_POST['entry_id']; 446 $entry_id = $_POST['entry_id'];