From 99e36dbe34dcec587c6ce60f61820ac976277e36 Mon Sep 17 00:00:00 2001 From: darode Date: Tue, 10 Apr 2012 15:35:13 +0000 Subject: [PATCH] 2012-04-10 Dario Rodriguez *operation/menu.php, godmode/menu.php: Fixed a bug showing extensions with new menu structure. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5927 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ pandora_console/godmode/menu.php | 52 ++++++++++++++++-------------- pandora_console/operation/menu.php | 47 +++++++++++---------------- 3 files changed, 51 insertions(+), 53 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 92e7c723b7..3dfe2f373c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-04-10 Dario Rodriguez + + *operation/menu.php, + godmode/menu.php: Fixed a bug showing extensions with new menu structure. + 2012-04-10 Juan Manuel Ramon * include/ajax/reporting.ajax.php diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index e406c109cc..9b734a7f4c 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -249,35 +249,37 @@ if (check_acl ($config['id_user'], 0, "PM")) { continue; } - //Check if was displayed inside other menu - //Check the ACL for this user $extmenu = $extension['godmode_menu']; - if ($extension['godmode_menu']["fatherId"] != '' - || ! check_acl ($config['id_user'], 0, $extmenu['acl']) - || $extension["godmode_menu"]["sec2"] == "") { + + //Check the ACL for this user + if (! check_acl ($config['id_user'], 0, $extmenu['acl'])) { continue; } - $sub[$extmenu["sec2"]]["text"] = $extmenu["name"]; - $sub[$extmenu["sec2"]]["refr"] = 0; - - if (array_key_exists('fatherId',$extmenu)) { - if (strlen($extmenu['fatherId']) > 0) { - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); - if ($extmenu["name"] != 'DB interface'){ - if (!empty($config['refr'])){ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; - } - else{ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; - } - } - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon']; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions'; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise']; - - $menu[$extmenu['fatherId']]['hasExtensions'] = true; + //Check if was displayed inside other menu + if ($extension['godmode_menu']["fatherId"] == '') { + $sub[$extmenu["sec2"]]["text"] = $extmenu["name"]; + $sub[$extmenu["sec2"]]["refr"] = 0; + } else { + + if (array_key_exists('fatherId',$extmenu)) { + if (strlen($extmenu['fatherId']) > 0) { + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); + if ($extmenu["name"] != 'DB interface'){ + if (!empty($config['refr'])){ + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; + } + else{ + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; + } + } + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon']; + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions'; + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true; + $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise']; + + $menu[$extmenu['fatherId']]['hasExtensions'] = true; + } } } } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index f4ac3c7262..ec52dea851 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -363,38 +363,29 @@ if (check_acl ($config['id_user'], 0, "AR")) { continue; } - //Check if was displayed inside other menu - if ($extension["operation_menu"]["fatherId"] != '' || $extension["operation_menu"]["sec2"] == "") { - continue; - } - $extension_menu = $extension["operation_menu"]; - $sub[$extension_menu["sec2"]]["text"] = $extension_menu["name"]; - $sub[$extension_menu["sec2"]]["refr"] = 0; + + //Check if was displayed inside other menu + if ($extension["operation_menu"]["fatherId"] == '') { + + $sub[$extension_menu["sec2"]]["text"] = $extension_menu["name"]; + $sub[$extension_menu["sec2"]]["refr"] = 0; + } else { + if (array_key_exists('fatherId',$extension_menu)) { + if (strlen($extension_menu['fatherId']) > 0) { + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']); + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0; + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon']; + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["sec"] = 'extensions'; + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["extension"] = true; + $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise']; + $menu[$extension_menu['fatherId']]['hasExtensions'] = true; + } + } + } } $menu["extensions"]["sub"] = $sub; - - /** - * Add the extensions - */ - foreach($config['extensions'] as $extension) { - $operationModeMenu = $extension['operation_menu']; - if ($operationModeMenu == null) - continue; - - if (array_key_exists('fatherId',$operationModeMenu)) { - if (strlen($operationModeMenu['fatherId']) > 0) { - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["text"] = __($operationModeMenu['name']); - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["refr"] = 0; - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["icon"] = $operationModeMenu['icon']; - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["sec"] = 'extensions'; - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["extension"] = true; - $menu[$operationModeMenu['fatherId']]['sub'][$operationModeMenu['sec2']]["enterprise"] = $extension['enterprise']; - $menu[$operationModeMenu['fatherId']]['hasExtensions'] = true; - } - } - } } }