/** * Make sure only the active branch is visible * * @param array $activeBranch Of \Gems_Menu_Menu Abstract items * @return \Gems_Menu_MenuAbstract (continuation pattern) */ protected function setBranchVisible(array $activeBranch) { parent::setBranchVisible($activeBranch); $child = end($activeBranch); $store = self::_getSessionStore($this->get('label')); $contr = $child->get('controller'); $action = $child->get('action'); $store->controller = $contr; $store->action = $action; $this->set('controller', $contr); $this->set('action', $action); return $this; }
/** * * @staticvar \MUtil_Html_HtmlElement $blank What to display when blank * @param \MUtil_Html_HtmlElement $td The element / cell to add the conditional link * @param \MUtil_Model_Bridge_TableBridge $bridge * @param string $icon Name of icon file * @param \Gems_Menu_SubMenuItem $menuItem The menu item to add * @param mixed $options Other values for for link (not used for blank) * @return void */ protected function addFileImage(\MUtil_Html_HtmlElement $td, \MUtil_Model_Bridge_TableBridge $bridge, $icon, \Gems_Menu_SubMenuItem $menuItem = null, $options = null) { static $blank; if (!$menuItem) { return; } if (!$blank) { $blank = \MUtil_Html::create('img', array('src' => 'blank.png', 'alt' => '', 'class' => 'file-icon')); } $href = $menuItem->toHRefAttribute($this->request, $bridge); $title = array(strtolower($menuItem->get('label')), $bridge->relpath); $img = \MUtil_Html::create('img', array('src' => $icon, 'alt' => $title, 'class' => 'file-icon')); $td->iflink($href, array($href, $img, array('title' => $title), $options), $blank); }
/** * Add a menu item to this list * * @param \Gems_Menu_SubMenuItem $menuItem * @param string $label Optional alternative label * @return \Gems_Menu_MenuList (continuation pattern) */ public function addMenuItem(\Gems_Menu_SubMenuItem $menuItem, $label = null) { $key = $this->_getKey($menuItem->get('controller'), $menuItem->get('action')); if ($label) { $this->altLabels[$key] = $label; } $this->offsetSet($key, $menuItem); return $this; }
public function setCurrent(\Gems_Menu_SubMenuItem $item) { if ('autofilter' == $item->get('action')) { $this->_currentMenuItem = $item->getParent(); } else { $this->_currentMenuItem = $item; } }