diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index aeb0271b2..c0429d58b 100644 --- a/html/css/style-classic7.css +++ b/html/css/style-classic7.css @@ -3519,7 +3519,18 @@ margin:1px; .nav-level2 .active { border-radius:0px !important; } - +/******************************************/ +/* MENU LEVEL > 3 */ +/******************************************/ +.nav-level4{ + --border-size:2px; +} +.nav-level4 .nav-item:hover{ + background-color: aliceblue; +} +.nav-level4 .active { + background-color: aliceblue; +} /****************************************/ /* Module for smartphone menu */ /***************************************/ diff --git a/html/do.php b/html/do.php index e09e51cbc..7db6f5f2a 100644 --- a/html/do.php +++ b/html/do.php @@ -281,7 +281,8 @@ if (isset($_REQUEST['ac'])) // Show module and highligt selected one show_module($module_id); - + global $level; + $level = 0; show_menu( $amenu_id[0]['pm_id_v3']); show_menu( $amenu_id[0]['pm_id_v2']); diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php index c7bad6b60..416e948c3 100644 --- a/include/anc_od.inc.php +++ b/include/anc_od.inc.php @@ -50,7 +50,7 @@ echo ' //---------------------------------------------------------------------- // show the menu //---------------------------------------------------------------------- -echo ShowItem(array( +echo show_menu_extension(array( array( "?".http_build_query(["ac"=>$http->request("ac"),"new"=>1,"gDossier"=>$dossier_id]), _("Nouveau"), @@ -61,7 +61,7 @@ echo ShowItem(array( _("Liste"), _("Liste opérations") ) -), "H", "nav-item", "nav-link", "", "nav nav-pills nav-level3"); +)); //---------------------------------------------------------------------- diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index c761b969c..82152711c 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -519,7 +519,57 @@ function sql_string($p_string) $p_string = noalyss_str_replace('\\', '\\\\', $p_string); return $p_string; } +/** + * @brief Same menu for all extensions, with the right level, it calls + * ShowItem with the right parameters + * @global $level (int) global variable of the menu level + * @param $p_array (array) + * @param $default (string) selected item + * @param $p_extra (string) extra code for the table tag (CSS or javascript) + * @see ShowItem + */ +function show_menu_extension($p_array,$default="",$p_extra="") +{ + global $level; + + + $level++; + switch ($level) { + case 3: + $p_dir='H'; + $class="nav-item nav-item-underline"; + $class_ref="nav-link"; + $p_extra="noprint nav nav-pills nav-level3"; + $class_div="menu3"; + break; + case 2: + $p_dir='H'; + $class="nav-item nav-item-underline"; + $class_ref="nav-link"; + $p_extra="noprint nav nav-pills nav-level2"; + $class_div="menu2"; + break; + case 1: + $p_dir='H'; + $class="nav-item nav-item-underline"; + $class_ref="nav-link"; + $p_extra='noprint nav nav-pills nav-fill flex-row '; + $class_div="top_menu"; + break; + default: + $p_dir='H'; + $class="nav-item nav-item-underline"; + $class_ref="nav-link"; + $p_extra="noprint nav nav-level4"; + $class_div="menu3"; + break; + } + return "