diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f2ca35611f9..ace308db4bd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1373,8 +1373,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $num=count($menu_array); for ($i = 0; $i < $num; $i++) { + $showmenu=true; + if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) { + $showmenu=false; + } + $alt++; - if (empty($menu_array[$i]['level'])) + if (empty($menu_array[$i]['level']) && $showmenu) { if (($alt%2==0)) { @@ -1409,11 +1414,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) { print ''."\n"; } - else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) + else if ($showmenu) { print ''."\n"; } - print ''."\n"; + if ($showmenu) + print ''."\n"; } // Menu niveau > 0 if ($menu_array[$i]['level'] > 0) @@ -1428,7 +1434,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if (! strstr($menu_array[$i]['titre'],''; print ''."\n"; } - else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) + else if ($showmenu) { print ''."\n"; } @@ -1437,7 +1443,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) // If next is a new block or end if (empty($menu_array[$i+1]['level'])) { - print ''."\n"; + if ($showmenu) + print ''."\n"; print "\n"; } }