From dcee34c715b2fcff4c0643c32f732ada1efdfb43 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 15 Oct 2014 18:14:56 +0200 Subject: [PATCH] Added a special behaviour when the section is 'mobile' to get the Pandora FMS mobile sections --- pandora_console/include/ajax/menu.ajax.php | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/menu.ajax.php b/pandora_console/include/ajax/menu.ajax.php index 43b8749046..aafc035c1f 100644 --- a/pandora_console/include/ajax/menu.ajax.php +++ b/pandora_console/include/ajax/menu.ajax.php @@ -18,7 +18,29 @@ if ($get_sec_pages) { $sec = get_parameter('sec'); $menu_hash = get_parameter('menu_hash'); - $pages = menu_get_sec_pages($sec,$menu_hash); + // WARNING: 'mobile' is a very special section + if ($sec === 'mobile') { + global $config; + require_once($config['homedir']."/mobile/operation/home.php"); + + $home = new Home(); + $pagesItems = $home->getPagesItems(); + + if (empty($pagesItems)) { + $pagesItems = array(); + } + else { + ksort($pagesItems); + } + + $pages = array(); + foreach ($pagesItems as $page => $data) { + $pages[$page] = $data['name']; + } + } + else { + $pages = menu_get_sec_pages($sec,$menu_hash); + } echo json_encode($pages); return;