Commit 0e655335 authored by Ad Schellevis's avatar Ad Schellevis

(menu/api) add search all, empty search string

parent 1e0365fd
...@@ -221,7 +221,10 @@ class MenuController extends ApiControllerBase ...@@ -221,7 +221,10 @@ class MenuController extends ApiControllerBase
{ {
$menu_items = $this->getMenu(null); $menu_items = $this->getMenu(null);
$query = $this->request->get("q", null, null); $query = $this->request->get("q", null, null);
if ($query != null) {
// only search when a query is provided, otherwise return all entries
$this->search($menu_items, $query); $this->search($menu_items, $query);
}
$items = array(); $items = array();
$this->extractMenuLeaves($menu_items, $items); $this->extractMenuLeaves($menu_items, $items);
return $items; return $items;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment