Fix mainmenu was not correctly set with auguria menu
This commit is contained in:
parent
34f3552dc7
commit
267170b8d2
@ -81,10 +81,10 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$url = $shorturl = $tmp[0];
|
||||
$param = (isset($tmp[1])?$tmp[1]:'');
|
||||
|
||||
// Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined.
|
||||
// Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined.
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url']))
|
||||
{
|
||||
$param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['url'].'&leftmenu=';
|
||||
$param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
|
||||
}
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url']))
|
||||
{
|
||||
@ -94,6 +94,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
||||
//$shorturl = $shorturl.($param?'?'.$param:'');
|
||||
$shorturl = $url;
|
||||
|
||||
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
||||
}
|
||||
|
||||
@ -126,7 +127,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
// Output menu entries
|
||||
foreach($menu->liste as $menkey => $menuval)
|
||||
{
|
||||
if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'],$menuval['classname'],$menuval['enabled']);
|
||||
if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'],$menuval['classname'],$menuval['enabled']);
|
||||
if (empty($noout)) print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
|
||||
if (empty($noout)) print_end_menu_entry_auguria($menuval['enabled']);
|
||||
}
|
||||
|
||||
@ -1583,7 +1583,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$url = $shorturl = $tmp[0];
|
||||
$param = (isset($tmp[1])?$tmp[1]:''); // params in url of the menu link
|
||||
|
||||
// Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined.
|
||||
// Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined.
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu']))
|
||||
{
|
||||
$param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu=';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user