- Bug fix: make GetMenuIndexByTitle work !

SVN:trunk[492]
This commit is contained in:
Denis Flaven
2010-06-28 13:24:42 +00:00
parent 2ac4d13517
commit e1f55c9c57

View File

@@ -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;
}
}