]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Poche.class.php
Implemented rudimental search engine
[github/wallabag/wallabag.git] / inc / poche / Poche.class.php
index b1143d0b584a4c1a968fd0352676dafa877e42ca..74a185bd6c2099537968752efc8d5b32003b45c5 100755 (executable)
@@ -603,6 +603,14 @@ class Poche
                     'tags' => $tags,
                 );
                 break;
+                               
+                       case 'search':
+                               if (isset($_POST['search'])){
+                                       $search = $_POST['search'];
+                                       $tpl_vars['entries'] = $this->store->search($search);
+                                       $tpl_vars['nb_results'] = count($tpl_vars['entries']);
+                               }
+                               break;
             case 'view':
                 $entry = $this->store->retrieveOneById($id, $this->user->getId());
                 if ($entry != NULL) {
@@ -772,8 +780,7 @@ class Poche
         $this->emptyCache();
         
         Tools::redirect('?view=config');
-    }
-
+    }  
     /**
      * get credentials from differents sources
      * it redirects the user to the $referer link