mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
- Bug fix: make GetMenuIndexByTitle work !
SVN:trunk[492]
This commit is contained in:
@@ -70,6 +70,10 @@ class ApplicationMenu
|
||||
*/
|
||||
static public function InsertMenu(MenuNode $oMenuNode, $iParentIndex = -1, $fRank)
|
||||
{
|
||||
$index = self::GetMenuIndexByTitle($oMenuNode->GetRawTitle());
|
||||
if ($index == -1)
|
||||
{
|
||||
// The menu does not already exist, insert it
|
||||
$index = count(self::$aMenusIndex);
|
||||
self::$aMenusIndex[$index] = array( 'node' => $oMenuNode, 'children' => array());
|
||||
if ($iParentIndex == -1)
|
||||
@@ -80,6 +84,7 @@ class ApplicationMenu
|
||||
{
|
||||
self::$aMenusIndex[$iParentIndex]['children'][] = array ('rank' => $fRank, 'index' => $index);
|
||||
}
|
||||
}
|
||||
return $index;
|
||||
}
|
||||
|
||||
@@ -187,7 +192,7 @@ class ApplicationMenu
|
||||
{
|
||||
if ($aMenu['node']->GetRawTitle() == $sTitle)
|
||||
{
|
||||
$id = $aMenu['node']->GetIndex();
|
||||
$index = $aMenu['node']->GetIndex();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user