]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[add] mark all as read #385
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Wed, 12 Feb 2014 20:52:01 +0000 (21:52 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Wed, 12 Feb 2014 20:52:01 +0000 (21:52 +0100)
inc/poche/Database.class.php
inc/poche/Poche.class.php

index 0457af6913ada9a34a56fa9903384c5eab1ff4f5..9f553fa189f2f7bfa0bdb8bd7535e7c8e55d2ad7 100644 (file)
@@ -318,6 +318,12 @@ class Database {
         $query          = $this->executeQuery($sql_action, $params_action);
     }
 
+    public function archiveAll($user_id) {
+        $sql_action     = "UPDATE entries SET is_read=? WHERE user_id=? AND is_read=?";
+        $params_action  = array($user_id, 1, 0);
+        $query          = $this->executeQuery($sql_action, $params_action);
+    }
+
     public function getLastId($column = '') {
         return $this->getHandle()->lastInsertId($column);
     }
index 9345d1c1cd9a73bbbf4e863a7ce445e0be24fe0f..a786c8df5a97a37a079636cd9289da9afa7ddd68 100644 (file)
@@ -434,6 +434,13 @@ class Poche
                     Tools::redirect();
                 }
                 break;
+            case 'archive_all' :
+                $this->store->archiveAll($this->user->getId());
+                Tools::logm('archive all links');
+                if (!$import) {
+                    Tools::redirect();
+                }
+                break;
             case 'add_tag' :
                 $tags = explode(',', $_POST['value']);
                 $entry_id = $_POST['entry_id'];