'; $sec = (string) get_parameter ('sec'); $sec2 = (string) get_parameter ('sec2'); echo ''; foreach ($menu as $mainsec => $main) { $extensionInMenuParameter = (string) get_parameter ('extension_in_menu',''); $showSubsection = true; if ($extensionInMenuParameter != '') { if ($extensionInMenuParameter == $mainsec) $showSubsection = true; else $showSubsection = false; } if ($mainsec == 'class') continue; if (! isset ($main['id'])) { $id = 'menu_'.++$idcounter; } else { $id = $main['id']; } $submenu = false; $classes = array ('menu_icon'); if (isset ($main["sub"])) { $classes[] = 'has_submenu'; $submenu = true; } if (!isset ($main["refr"])) $main["refr"] = 0; if (($sec == $mainsec) && ($showSubsection)) { $classes[] = 'selected'; } else { $classes[] = 'not_selected'; if ($extensionInMenuParameter == $mainsec) $classes[] = 'selected'; } $output = ''; if (! $submenu) { $main["sub"] = array (); //Empty array won't go through foreach } $submenu_output = ''; $selected = false; $visible = false; foreach ($main["sub"] as $subsec2 => $sub) { // Choose valid suboptions (sec2) if (enterprise_hook ('acl_enterprise', array ($config['id_user'], $mainsec, $subsec2)) == false){ continue; } //Set class if (($sec2 == $subsec2 && isset ($sub[$subsec2]["options"])) && (get_parameter_get ($sub[$subsec2]["options"]["name"]) == $sub[$subsec2]["options"]["value"])) { //If the subclass is selected and there are options and that options value is true $class = 'submenu_selected'; $selected = true; $visible = true; } elseif ($sec2 == $subsec2 && !isset ($sub[$subsec2]["options"])) { $class = 'submenu_selected'; $selected = true; $hasExtensions = (array_key_exists('hasExtensions',$main)) ? $main['hasExtensions'] : false; if (($extensionInMenuParameter != '') && ($hasExtensions)) $visible = true; else $visible = false; } else { //Else it's not selected $class = 'submenu_not_selected'; } if (! isset ($sub["refr"])) { $sub["refr"] = 0; } if (isset ($sub["type"]) && $sub["type"] == "direct") { //This is an external link $submenu_output .= '
  • '.$sub["text"]."
  • "; } else { //This is an internal link if (isset ($sub[$subsec2]["options"])) { $link_add = "&".$sub[$subsec2]["options"]["name"]."=".$sub[$subsec2]["options"]["value"]; } else { $link_add = ""; } $submenu_output .= ''; //Ini Add icon extension $secExtension = null; if (array_key_exists('extension',$sub)) $secExtensionBool = $sub["extension"]; else $secExtensionBool = false; if ($secExtensionBool) { $imageIcon = 'images/extensions.png'; if (strlen($sub["icon"]) > 0) $imageIcon ='extensions/'.$sub["icon"]; $submenu_output .= '
     
    '; } $secExtension = null; if (array_key_exists('sec',$sub)) $secExtension = $sub["sec"]; if (strlen($secExtension) > 0) { $secUrl = $secExtension; $extensionInMenu = 'extension_in_menu='.$mainsec.'&'; } else { $secUrl = $mainsec; $extensionInMenu = ''; } $submenu_output .= ''.$sub["text"].''; $submenu_output .= ''; } } // Choose valid section (sec) if (enterprise_hook ('acl_enterprise', array ($config['id_user'], $mainsec, $main["sec2"])) == false){ continue; } //Print out the first level $output .= '
  • '; $output .= ''.$main["text"].'toggle'; if ($submenu_output != '') { //WARNING: IN ORDER TO MODIFY THE VISIBILITY OF MENU'S AND SUBMENU'S (eg. with cookies) YOU HAVE TO ADD TO THIS ELSEIF. DON'T MODIFY THE CSS if ($visible || in_array ("selected", $classes)) { $visible = true; } if (!$showSubsection) { $visible = false; } $output .= ''; } $output .= '
  • '; echo $output; } echo ''; //Invisible UL for adding border-top echo ''; } ?>