mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix incorrect admin menu opening in Dashboard #2345
This commit is contained in:
parent
1dbf601bab
commit
3a91bc3038
1 changed files with 16 additions and 7 deletions
|
|
@ -112,14 +112,21 @@ class Base extends \ModuleObject
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!$subMenuTitle && count($moduleMenus))
|
||||
if (!$subMenuTitle && $currentAct && count($moduleMenus))
|
||||
{
|
||||
$subMenuTitle = array_first($moduleMenus)->title;
|
||||
}
|
||||
if (!$subMenuTitle)
|
||||
{
|
||||
$moduleInfo = \ModuleModel::getModuleInfoXml($module);
|
||||
$subMenuTitle = $moduleInfo->title ?? 'Dashboard';
|
||||
if ($currentAct)
|
||||
{
|
||||
$moduleInfo = \ModuleModel::getModuleInfoXml($module);
|
||||
$subMenuTitle = $moduleInfo->title ?? 'Dashboard';
|
||||
}
|
||||
else
|
||||
{
|
||||
$subMenuTitle = 'Dashboard';
|
||||
}
|
||||
}
|
||||
|
||||
// get current menu's srl(=parentSrl)
|
||||
|
|
@ -135,12 +142,14 @@ class Base extends \ModuleObject
|
|||
$firstChild = current($parentMenu['list']);
|
||||
$menu->list[$parentKey]['href'] = $firstChild['href'];
|
||||
}
|
||||
|
||||
foreach ($parentMenu['list'] as $childMenu)
|
||||
if ($currentAct)
|
||||
{
|
||||
if ($subMenuTitle == $childMenu['text'] && $parentSrl == 0)
|
||||
foreach ($parentMenu['list'] as $childMenu)
|
||||
{
|
||||
$parentSrl = $childMenu['parent_srl'];
|
||||
if (preg_match('/\b' . preg_quote($currentAct, '/') . '$/', $childMenu['href']))
|
||||
{
|
||||
$parentSrl = $childMenu['parent_srl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue