diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-01-08 20:38:23 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-01-08 20:38:23 +0100 |
commit | b1e758012b3d801d5ab266e53e830fb7091508a2 (patch) | |
tree | ee0cd5ba082f35a7df42c1973865bd63d2254bc8 | |
parent | c837868af892ada4c25333bec46583a0d42a240d (diff) | |
download | rpg-b1e758012b3d801d5ab266e53e830fb7091508a2.tar.gz rpg-b1e758012b3d801d5ab266e53e830fb7091508a2.tar.bz2 |
show a message when search returns no results
-rw-r--r-- | lib/plugins/extension/helper/gui.php | 10 | ||||
-rw-r--r-- | lib/plugins/extension/helper/list.php | 8 |
2 files changed, 15 insertions, 3 deletions
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 @@ -89,6 +89,14 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { } /** + * Show message when no results are found + */ + function nothing_found() { + global $lang; + $this->form .= '<li class="notfound">'.$lang['nothingfound'].'</li>'; + } + + /** * Print the form */ function render() { |