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];
|
$url = $shorturl = $tmp[0];
|
||||||
$param = (isset($tmp[1])?$tmp[1]:'');
|
$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']))
|
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']))
|
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:'');
|
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
||||||
//$shorturl = $shorturl.($param?'?'.$param:'');
|
//$shorturl = $shorturl.($param?'?'.$param:'');
|
||||||
$shorturl = $url;
|
$shorturl = $url;
|
||||||
|
|
||||||
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1583,7 +1583,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$url = $shorturl = $tmp[0];
|
$url = $shorturl = $tmp[0];
|
||||||
$param = (isset($tmp[1])?$tmp[1]:''); // params in url of the menu link
|
$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']))
|
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu']))
|
||||||
{
|
{
|
||||||
$param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu=';
|
$param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu=';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user