Пример #1
0
 public static function getResources(SysModule $parent, $filter = false, $addEmpty = true, $module = null, $controller = null)
 {
     if ($parent->getAction()) {
         throw new Exception('can\'t add to parent with action');
     }
     $return = array();
     $return[] = 'wybierz';
     if ($controller == null) {
         if ($module == null) {
             $return = array_merge($return, self::getModules($filter));
         } else {
             $return = array_merge($return, self::getControllers($filter, $module));
         }
     } else {
         $return = array_merge($return, self::getActions($module, $controller));
     }
     if ($addEmpty) {
         $return['x'] = 'pusty kontener';
     }
     return $return;
 }
Пример #2
0
 /**
  * @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;
 }