From b1e758012b3d801d5ab266e53e830fb7091508a2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 8 Jan 2014 20:38:23 +0100 Subject: show a message when search returns no results --- lib/plugins/extension/helper/gui.php | 10 +++++++--- lib/plugins/extension/helper/list.php | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 953d50fa6..3a0f0c589 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -106,9 +106,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /* @var helper_plugin_extension_list $list */ $list = $this->loadHelper('extension_list'); $list->start_form(); - foreach($result as $name) { - $extension->setExtension($name); - $list->add_row($extension, $extension->getID() == $this->infoFor); + if($result){ + foreach($result as $name) { + $extension->setExtension($name); + $list->add_row($extension, $extension->getID() == $this->infoFor); + } + } else { + $list->nothing_found(); } $list->end_form(); $list->render(); diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index ba3681ce4..8cc303fbe 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -88,6 +88,14 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $this->form .= ''.DOKU_LF; } + /** + * Show message when no results are found + */ + function nothing_found() { + global $lang; + $this->form .= '
  • '.$lang['nothingfound'].'
  • '; + } + /** * Print the form */ -- cgit v1.2.3