do not show debug menu if all items are inaccessible

This commit is contained in:
Uwe Steinmann 2022-05-17 07:45:05 +02:00
parent 983af33300
commit 1ae35ca6ad
2 changed files with 10 additions and 6 deletions

View File

@ -1019,9 +1019,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
}
if ($settings->_enableDebugMode) {
$menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug'));
if ($accessobject->check_view_access('Hooks'))
$menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks'));
if($accessobject->check_view_access(array('Hooks'))) {
$menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug'));
if ($accessobject->check_view_access('Hooks'))
$menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks'));
}
}
/* Check if hook exists because otherwise callHook() will override $menuitems */

View File

@ -927,9 +927,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
}
if ($settings->_enableDebugMode) {
$menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug'));
if ($accessobject->check_view_access('Hooks'))
$menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks'));
if($accessobject->check_view_access(array('Hooks'))) {
$menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug'));
if ($accessobject->check_view_access('Hooks'))
$menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks'));
}
}
/* Check if hook exists because otherwise callHook() will override $menuitems */