Пример #1
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;
 }
Пример #2
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;
 }
Пример #3
0
 /**
  * Check whether provided item is last in list
  *
  * @param Mage_Backend_Model_Menu_Item $item
  * @return bool
  */
 public function isLast(Mage_Backend_Model_Menu_Item $item)
 {
     return $this->offsetGet(max(array_keys($this->getArrayCopy())))->getId() == $item->getId();
 }