fix
This commit is contained in:
parent
ca0a04bc24
commit
0df973e534
1 changed files with 16 additions and 11 deletions
|
|
@ -47,18 +47,18 @@ class MenuCategory extends Menu
|
|||
{
|
||||
return $this->last_menu;
|
||||
}
|
||||
|
||||
public function buildHtml()
|
||||
{
|
||||
global $g5, $is_admin, $auth, $menu, $auth_menu;
|
||||
$sub_menu = str_replace([G5_ADMIN_URL, "/adm"], ["", ""], $_SERVER["SCRIPT_NAME"]);
|
||||
$sub_menu = preg_replace('/^.*\/([^\/]+\.php)$/', '/$1', str_replace([G5_ADMIN_URL, "/adm"], ["", ""], $_SERVER["SCRIPT_NAME"]));
|
||||
|
||||
$str = "<ul class=\"gnb_2dul\">";
|
||||
foreach ($this->childmenu as $key => $menu) {
|
||||
if ($is_admin != 'super')
|
||||
continue;
|
||||
|
||||
if (!$menu->display) continue;
|
||||
if (!$menu->display)
|
||||
continue;
|
||||
|
||||
if (($menu->gnb_grp_div == 1 && $gnb_grp_style == false) || ($menu->gnb_grp_div != 1 && $gnb_grp_style == true))
|
||||
$gnb_grp_div = 'gnb_grp_div';
|
||||
|
|
@ -71,7 +71,12 @@ class MenuCategory extends Menu
|
|||
$gnb_grp_style = '';
|
||||
|
||||
$check_gnb_grp_style = "";
|
||||
if (str_replace([G5_ADMIN_URL, "/adm"], ["", ""], $menu->url) == $sub_menu || in_array($sub_menu, $menu->suburl)) {
|
||||
$menu_url = preg_replace('/^.*\/([^\/]+\.php)$/', '/$1', str_replace([G5_ADMIN_URL, "/adm"], ["", ""], $menu->url));
|
||||
if (
|
||||
$menu_url == $sub_menu || in_array($sub_menu, array_map(function ($url) {
|
||||
return preg_replace('/^.*\/([^\/]+\.php)$/', '/$1', str_replace([G5_ADMIN_URL, "/adm"], ["", ""], $url));
|
||||
}, $menu->suburl))
|
||||
) {
|
||||
$check_gnb_grp_style = "check";
|
||||
$this->selected = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue