/** * @param SysModule $module * @return Zend_Navigation_Page */ private function createPage(SysModule $module) { $resourceId = $module->getId(); if ($module->isMvcPage()) { $page = new Zend_Navigation_Page_Mvc(); $page->setLabel($module->getName()); $page->setOptions(array('icon' => $module->getIcon(), 'title' => $module->getTitle(), 'subtitle' => $module->getSubTitle(), 'inMenu' => $module->getInMenu())); $page->setModule($module->getModule()); $page->setController($module->getController()); $page->setAction($module->getAction()); //$page->setClass('ui-state-default ui-corner-top'); } else { $page = new Zend_Navigation_Page_Uri(); $page->setOptions(array('icon' => $module->getIcon(), 'title' => $module->getTitle(), 'subtitle' => $module->getSubTitle(), 'inMenu' => $module->getInMenu())); $page->setLabel($module->getName()); $page->setActive(false); //$page->setClass('ui-state-default ui-corner-top'); $page->setUri('javascript:void(0);'); } if ($resourceId) { $page->setResource((string) $resourceId); } return $page; }
/** * @param $uri * @param string $label * @param bool $active * @return Zend_Navigation_Page_Uri */ protected function _addPage($uri = '', $label = '', $active = true) { $page = new Zend_Navigation_Page_Uri(); if (is_string($uri)) { $page->setUri($uri); } elseif (is_array($uri)) { if (isset($uri['route']) && is_array($uri['route'])) { if (!isset($uri['routeName'])) { $uri['routeName'] = 'default'; } $page->setUri($this->view->url($uri['route'], false, $uri['routeName'])); } } $page->setLabel($label); if ($active) { $page->setActive(); } return $page; }