Пример #1
0
 public function testGetChildrenCreatesSubmenuOnFirstCall()
 {
     $menuMock = $this->getMock('Mage_Backend_Model_Menu', array(), array(), '', false);
     $this->_menuFactoryMock->expects($this->once())->method('getMenuInstance')->will($this->returnValue($menuMock));
     $this->_model->getChildren();
     $this->_model->getChildren();
 }
Пример #2
0
 /**
  * Check whether given item is currently selected
  *
  * @param Mage_Backend_Model_Menu_Item $item
  * @param int $level
  * @return bool
  */
 protected function _isItemActive(Mage_Backend_Model_Menu_Item $item, $level)
 {
     $itemModel = $this->getActiveItemModel();
     $output = false;
     if ($level == 0 && $itemModel instanceof Mage_Backend_Model_Menu_Item && ($itemModel->getId() == $item->getId() || $item->getChildren()->get($itemModel->getId()) !== null)) {
         $output = true;
     }
     return $output;
 }
Пример #3
0
 /**
  * Check whether given item is currently selected
  *
  * @param Mage_Backend_Model_Menu_Item $item
  * @return bool
  */
 public function isItemActive(Mage_Backend_Model_Menu_Item $item)
 {
     $itemModel = $this->getContainerRenderer()->getActiveItemModel();
     $output = false;
     if ($this->getLevel() == 0 && $itemModel instanceof Mage_Backend_Model_Menu_Item && ($itemModel->getId() == $item->getId() || $item->getChildren()->get($itemModel->getId()) !== null)) {
         $output = true;
     }
     return $output;
 }