From dd23c027d45fc55237a205f85d2b3c1221d6027f Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 27 Jun 2010 00:02:33 +0200 Subject: [PATCH] Changes warning on empty quick search (Closes #1138). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/search.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/search.php b/modules/search.php index 7edd6e8..4386c99 100644 --- a/modules/search.php +++ b/modules/search.php @@ -48,10 +48,20 @@ class SearchModule extends PLModule global $globals; if (Env::has('quick') || $action == 'geoloc') { - $quick = trim(Env::t('quick')); + $quick = Env::t('quick'); if (S::logged() && !Env::has('page')) { S::logger()->log('search', 'quick=' . $quick); } + + if ($quick == '') { + $page->trigWarning('Aucun critère de recherche n\'est spécifié.'); + $page->changeTpl('search/index.tpl'); + $page->setTitle('Annuaire'); + $page->assign('formulaire', 1); + $page->addJsLink('ajax.js'); + return; + } + $list = 'profile|prf|fiche|fic|referent|ref|mentor'; if (S::admin()) { $list .= '|admin|adm|ax'; -- 2.1.4