Beispiel #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;
 }
Beispiel #2
0
 private function addChildren(Zend_Navigation_Container $nav, SysModule $module)
 {
     $children = $module->getChildren();
     /* @var $module SysModule */
     foreach ($children as $module) {
         $page = $this->createPage($module);
         if ($module->hasChildren()) {
             if ($module->countChildren() > 1) {
                 $this->addChildren($page, $module);
             } else {
                 /** @var SysModule $child */
                 $child = $module->getFirstChild();
                 $page = $this->createPage($child);
             }
         }
         $nav->addPage($page);
         if ($page->isActive()) {
             $nav->setActive(true);
         }
     }
 }