From a33a3d2afb6a861e194599973e31e5e448617296 Mon Sep 17 00:00:00 2001 From: tcit Date: Sat, 22 Mar 2014 11:09:18 +0100 Subject: Implemented rudimental search engine --- inc/poche/Poche.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'inc/poche/Poche.class.php') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index b1143d0b..74a185bd 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -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 -- cgit v1.2.3