Пример #1
0
 public function indexAction()
 {
     if (!$this->_hasParam('id_category')) {
         $this->_setParam('id_category', 'all');
     }
     // display only the list on ajax request
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->_forward('list');
         return;
     }
     // add form
     $form = new Application_Form_Add();
     $form->getElement('id_category')->setValue($this->_getParam('id_category'));
     $this->view->form = $form;
     // build navigation with categories
     $navigation = new Zend_Navigation();
     $mvc = array('module' => 'default', 'controller' => 'index', 'action' => 'index');
     $navigation->addPage(array_merge($mvc, array('params' => array('id_category' => 'all'), 'label' => 'All', 'title' => 'All')));
     $mapper = new Application_Model_CategoryMapper();
     $categories = $mapper->fetchAll();
     foreach ($categories as $category) {
         $navigation->addPage(new Zend_Navigation_Page_Mvc(array_merge($mvc, array('params' => array('id_category' => $category->id_category), 'label' => $category->name, 'title' => $category->name))));
     }
     $this->view->navigation = $navigation;
     $this->view->categories = $this->_getCategories($categories);
 }
Пример #2
0
 protected function _initNavigation()
 {
     $this->bootstrap('layout');
     $this->bootstrap('acl');
     $layout = $this->getResource('layout');
     $view = $layout->getView();
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml');
     $navigation = new Zend_Navigation($config);
     $additionalNavigation = Zend_Registry::get('config')->navigation;
     $menu = $additionalNavigation->monitoring;
     $subMenu = $menu->enableDisable;
     $target = '';
     if ($subMenu->target) {
         $target = $subMenu->target;
     }
     $navigation->addPage(array('label' => $subMenu->label, 'uri' => $subMenu->uri, 'target' => $target));
     $menuPage = $navigation->findOneBy('label', 'Monitoring');
     $subMenuPage = $navigation->findOneBy('label', $subMenu->label);
     $subMenuPage->setParent($menuPage);
     $pluginAdminConsolePages = array();
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaAdminConsolePages');
     foreach ($pluginInstances as $pluginInstance) {
         foreach ($pluginInstance->getAdminConsolePages() as $pluginAdminConsolePage) {
             $pluginAdminConsolePages[] = $pluginAdminConsolePage;
         }
     }
     foreach ($pluginAdminConsolePages as $pluginAdminConsolePage) {
         if (!$pluginAdminConsolePage instanceof KalturaAdminConsolePlugin) {
             continue;
         }
         if (!$pluginAdminConsolePage->accessCheck(Kaltura_AclHelper::getCurrentPermissions())) {
             continue;
         }
         $navigation->addPage(array('label' => $pluginAdminConsolePage->getNavigationActionLabel(), 'controller' => 'plugin', 'action' => get_class($pluginAdminConsolePage)));
         $subMenuPage = $navigation->findOneBy('label', $pluginAdminConsolePage->getNavigationActionLabel());
         $menuPage = null;
         if ($pluginAdminConsolePage->getNavigationRootLabel()) {
             $menuPage = $navigation->findOneBy('label', $pluginAdminConsolePage->getNavigationRootLabel());
             if (!$menuPage) {
                 $navigation->addPage(array('label' => $pluginAdminConsolePage->getNavigationRootLabel(), 'controller' => 'plugin', 'action' => get_class($pluginAdminConsolePage)));
                 $menuPage = $navigation->findOneBy('label', $pluginAdminConsolePage->getNavigationRootLabel());
             }
         }
         if ($menuPage) {
             $subMenuPage->setParent($menuPage);
         }
     }
     $this->checkAclForNavigation($navigation);
     $view->navigation($navigation);
 }
 public function indexAction()
 {
     $breadcrumbs = new Zend_Navigation();
     $i = 0;
     $category = $this->getMediaCategory();
     if (!is_null($this->getMediaCategory())) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $category->getName(), 'uri' => !$this->getMediaItem() ? null : '/media/' . $category->getPath() . '/', 'active' => !$this->getMediaItem() ? true : false));
         $i--;
     }
     $mediaItem = $this->getMediaItem();
     if (!is_null($mediaItem)) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $mediaItem->getName(), 'active' => true));
         $i--;
     }
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Пресса', 'uri' => '/media/', 'order' => $i)));
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Главная', 'uri' => '/', 'order' => $i - 1)));
     $this->view->breadcrumbs = $breadcrumbs;
 }
 public function indexAction()
 {
     $breadcrumbs = new Zend_Navigation();
     $i = 0;
     $pipelineCategory = $this->getPageCategory();
     $pipelineItem = $this->getPageItem();
     if (!is_null($pipelineCategory)) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $pipelineCategory->getTitle(), 'uri' => !is_null($pipelineItem) ? '/pipeline/' . $pipelineCategory->getPath() . '/' : null, 'active' => !is_null($pipelineItem) ? false : true));
         $i--;
     }
     if (!is_null($pipelineItem)) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $pipelineItem->getTitle(), 'active' => true));
         $i--;
     }
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Детали трубопроводов', 'uri' => '/pipeline/', 'order' => $i)));
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Главная', 'uri' => '/', 'order' => $i - 1)));
     $this->view->breadcrumbs = $breadcrumbs;
 }
 public function indexAction()
 {
     $breadcrumbs = new Zend_Navigation();
     $i = 0;
     $manufactureCategory = $this->getPageCategory();
     $manufactureItem = $this->getPageItem();
     if (!is_null($manufactureCategory)) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $manufactureCategory->getTitle(), 'uri' => !is_null($manufactureItem) ? '/manufacture/' . $manufactureCategory->getPath() . '/' : null, 'active' => !is_null($manufactureItem) ? false : true));
         $i--;
     }
     if (!is_null($manufactureItem)) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $manufactureItem->getTitle(), 'active' => true));
         $i--;
     }
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Наше производство', 'uri' => '/manufacture/', 'order' => $i)));
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Главная', 'uri' => '/', 'order' => $i - 1)));
     $this->view->breadcrumbs = $breadcrumbs;
 }
Пример #6
0
 /**
  *
  */
 public function getSitemap()
 {
     if (is_null($this->_sitemap)) {
         $options = $this->getOptions();
         $front = $this->getBootstrap()->getResource('FrontController');
         $root = dirname($front->getModuleDirectory());
         //modules directory
         $acl = $this->getBootstrap()->getResource('Acl');
         $role = $this->getBootstrap()->getPluginResource('acl')->getRole();
         try {
             $dir = new DirectoryIterator($root);
         } catch (Exception $e) {
             throw new Streamwide_Exception("Directory {$root} not readable");
         }
         $this->_sitemap = new Zend_Navigation();
         foreach ($dir as $file) {
             if ($file->isDot() || !$file->isDir()) {
                 continue;
             }
             $module = $file->getFilename();
             // Don't use SCCS directories as modules
             if (preg_match('/^[^a-z]/i', $module) || 'CVS' == $module) {
                 continue;
             }
             $controllerPath = "{$root}/{$module}/controllers";
             $controllers = $this->_getControllers($controllerPath);
             foreach ($controllers as $controller => $class) {
                 $actions = $this->_getActions($class);
                 foreach ($actions as $action) {
                     $mca = new Streamwide_Web_Acl_Resource_Mca($module, strtolower($controller), strtolower($action));
                     $all = new Streamwide_Web_Acl_Resource_Mca('*', '*', '*');
                     if ($acl->has($mca) && !$acl->isAllowed($role, $mca)) {
                         continue;
                     }
                     if (!$acl->has($mca) && !$acl->isAllowed($role, $all)) {
                         continue;
                     }
                     $this->_sitemap->addPage(Zend_Navigation_Page::factory(array("label" => "{$module}/{$controller}/{$action}", "module" => $module, "controller" => $controller, "action" => $action)));
                 }
             }
         }
     }
     return $this->_sitemap;
 }
 public function navigationAction()
 {
     $bcn = new Zend_Navigation();
     $categoriesModel = new Model_DbTable_Categories();
     $category = $categoriesModel->find($this->getRequest()->getParam("category"))->current();
     if (!$category) {
         return;
     }
     $i = 0;
     $bcn->addPage(array("action" => "index", "controller" => "categories", "module" => "catalog", 'order' => $i, "params" => array('category' => $category->id), 'label' => $category->name));
     while ($category->parent_id) {
         $category = $category->findParentRow('Model_DbTable_Categories');
         $bcn->addPage(array("action" => "index", "controller" => "categories", "module" => "catalog", 'order' => $i, "params" => array('category' => $category->id), 'label' => $category->name));
         $i--;
     }
     $bcn->addPage(array("action" => "index", "controller" => "index", "module" => "catalog", 'label' => 'Каталог продукции', 'order' => $i));
     $bcn->addPage(array("action" => "index", "controller" => "index", "module" => "default", 'label' => 'Главная', 'order' => $i - 1));
     $this->view->navigation = $bcn;
 }
 public function indexAction()
 {
     // Force response to identify itself as XML, not sure it belongs in a controller
     $this->getResponse()->setHeader('Content-type', 'application/xml');
     $this->_helper->layout->disableLayout();
     $navigation = new Zend_Navigation();
     /* This is going to be hugely dirty. If this still exists in a few months you have my sincere apologies
        I only have a day to write this sitemap and I fully intend to come back and neaten it up at some point */
     // Home
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'Home';
     $page->uri = '/home';
     $page->changefreq = 'daily';
     $navigation->addPage($page);
     // Careers
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'Careers';
     $page->uri = '/careers';
     $page->changefreq = 'daily';
     $navigation->addPage($page);
     // News
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'News';
     $page->uri = '/news';
     $page->changefreq = 'weekly';
     $navigation->addPage($page);
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'Tenants News';
     $page->uri = '/tenants/news';
     $page->changefreq = 'weekly';
     $navigation->addPage($page);
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'Landlords News';
     $page->uri = '/landlords/news';
     $page->changefreq = 'weekly';
     $navigation->addPage($page);
     $page = new Zend_Navigation_Page_Uri();
     $page->label = 'Agents News';
     $page->uri = '/letting-agents/news';
     $page->changefreq = 'weekly';
     $navigation->addPage($page);
     $pageModel = new Datasource_Cms_Pages();
     $cmsPages = $pageModel->getPageList();
     foreach ($cmsPages as $cmsPage) {
         if (!in_array($cmsPage['url'], $this->_suppressCmsUrl)) {
             $page = new Zend_Navigation_Page_Uri();
             $page->label = $cmsPage['title'];
             $page->uri = '/' . $cmsPage['url'];
             $page->changefreq = 'hourly';
             $navigation->addPage($page);
         }
     }
     $this->view->navigation($navigation);
 }
Пример #9
0
 public function getAllProductsAction()
 {
     $this->setTitle(Axis::translate('sitemap')->__('Site Map All Products'));
     $products = Axis::single('catalog/product_category')->select()->distinct()->from('catalog_product_category', array())->joinLeft('catalog_product', 'cp.id = cpc.product_id', array('id'))->addName(Axis_Locale::getLanguageId())->addKeyWord()->addActiveFilter()->addDateAvailableFilter()->addSiteFilter(Axis::getSiteId())->order('cpd.name')->fetchAll();
     $menu = new Zend_Navigation();
     foreach ($products as $_product) {
         $uri = $this->view->hurl(array('cat' => array('value' => $_product['id'], 'seo' => $_product['key_word']), 'controller' => 'catalog', 'action' => 'view'), false, true);
         $class = 'nav-' . str_replace('.', '-', $_product['key_word']);
         $page = new Zend_Navigation_Page_Uri(array('label' => $_product['name'], 'title' => $_product['name'], 'uri' => $uri, 'class' => $class));
         $menu->addPage($page);
     }
     $this->view->menu = $menu;
     $this->render('products');
 }
 public function genBreadcrumbs()
 {
     $breadcrumbs = new Zend_Navigation();
     $categoriesMapper = new Catalog_Model_Mapper_Categories();
     $category = $this->getCategoryId() ? $categoriesMapper->find($this->getCategoryId(), new Catalog_Model_Categories()) : null;
     $i = 0;
     if (isset($category) && is_null($this->getProductId())) {
         $breadcrumbs->addPage(array('type' => 'uri', 'label' => $category->getName(), 'active' => true));
     }
     $parentCategories = $categoriesMapper->fetchTreeParentCategories($category->getParentId());
     if (!is_null($this->getProductId())) {
         $parentCategories = $categoriesMapper->fetchTreeParentCategories($this->getCategoryId());
     }
     if (!empty($parentCategories)) {
         foreach ($parentCategories as $parentCategory) {
             $breadcrumbs->addPage(array("action" => "index", "controller" => "categories", "module" => "catalog", 'order' => $i, 'route' => 'catalog', "params" => array('fullPath' => $parentCategory->id != 0 ? $parentCategory->full_path : null), 'reset_params' => true, 'encode_url' => false, 'label' => $parentCategory->name));
             $i--;
         }
     }
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Каталог', 'uri' => '/catalog/', 'order' => $i)));
     $breadcrumbs->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Главная', 'uri' => '/', 'order' => $i - 1)));
     return $breadcrumbs;
 }
Пример #11
0
 private function createNavigation()
 {
     $this->moduleConf = Dfi_Auth_Acl::getMapModules();
     $nav = new Zend_Navigation();
     $modules = SysModuleQuery::create()->filterByTreeLevel(1)->orderByTreeLeft()->find();
     foreach ($modules as $module) {
         /* @var $module SysModule */
         $page = $this->createPage($module);
         $nav->addPage($page);
         if ($module->hasChildren()) {
             if ($module->countChildren() > 1) {
                 $this->addChildren($page, $module);
             } else {
                 $child = $module->getFirstChild();
                 //$page->set
             }
         }
     }
     $this->navigation = $nav;
 }
 /**
  * @param Zend_Navigation $sitemap
  * @param $itemsMapper Catalog_Model_Mapper_Categories | Catalog_Model_Mapper_Products | Manufacture_Model_Mapper_ManufactureCategories | Manufacture_Model_Mapper_Manufacture | Pages_Model_Mapper_Pages | Pipeline_Model_Mapper_PipelineCategories | Pipeline_Model_Mapper_Pipeline | Oil_Model_Mapper_OilCategories | Oil_Model_Mapper_Oil | Media_Model_Mapper_MediaCategories | Media_Model_Mapper_Media
  * @return Zend_Navigation
  * @throws Zend_Navigation_Exception
  */
 protected function _addPagesSitemap(Zend_Navigation $sitemap, $itemsMapper)
 {
     $colsTable = $itemsMapper->getDbTable()->info('cols');
     //Zend_Debug::dump($colsTable);
     $baseUri = strtolower($this->_getNameModule($itemsMapper));
     $sectionUri = $baseUri != 'page' ? '/' . $baseUri . '/' : '/';
     $cache = Zend_Registry::get('cache');
     $cacheName = $this->_getNameSpace($itemsMapper) . '_All_Filter_deleted_active';
     if (!($items = $cache->load($cacheName))) {
         $select = $itemsMapper->getDbTable()->select();
         $select->where('deleted != ?', 1)->where('active != ?', 0)->order('sorting ASC');
         $items = $itemsMapper->fetchAll($select);
         $cache->save($items, $cacheName, array($this->_getNameModule($itemsMapper), $this->_getNameSpace($itemsMapper)));
     }
     if (!empty($items)) {
         foreach ($items as $item) {
             $uri = in_array('full_path', $colsTable) ? $item->getFullPath() : $item->getPath();
             if ($uri != '') {
                 $sitemap->addPage(array('type' => 'uri', 'uri' => $sectionUri . $uri . '/'));
             }
         }
     }
     return $sitemap;
 }
Пример #13
0
 /**
  * Adds a page to the menu.
  *
  * Supports the indication of deeper containers.
  *
  * @param   Enlight_Components_Menu_Item|Zend_Config|array $page
  * @return  Enlight_Components_Menu
  */
 public function addPage($page)
 {
     if ($page instanceof Zend_Config) {
         $page = $page->toArray();
     }
     if (is_array($page) && isset($page['parent']) && !$page['parent'] instanceof Zend_Navigation_Container) {
         $page['parent'] = $this->findOneBy('id', $page['parent']);
     }
     if (is_array($page)) {
         $page = call_user_func($this->_defaultPageClass . '::factory', $page);
     }
     /** @var Zend_Navigation_Container $container */
     $container = $page->get('parent');
     if ($container instanceof Zend_Navigation_Container) {
         $container->addPage($page);
     } else {
         parent::addPage($page);
     }
     return $this;
 }
 /**
  * @param $category_id
  * @return Zend_Navigation
  * @throws Zend_Navigation_Exception
  */
 public function containerNavigation($category_id)
 {
     $container = new Zend_Navigation();
     $categoriesMapper = new Catalog_Model_Mapper_Categories();
     $category = $categoriesMapper->find($category_id, new Catalog_Model_Categories());
     $i = 0;
     if ($category) {
         $container->addPage(array('type' => 'uri', 'label' => $category->getName(), 'active' => true));
     }
     $parentCategories = $categoriesMapper->fetchTreeParentCategories($category->getParentId());
     if (!empty($parentCategories)) {
         foreach ($parentCategories as $parentCategory) {
             $container->addPage(array("action" => "index", "controller" => "categories", "module" => "admin", 'order' => $i, 'route' => 'adminCategoriesEdit', "params" => array('parent_id' => $parentCategory->id != 0 ? $parentCategory->id : null), 'reset_params' => true, 'encode_url' => false, 'label' => $parentCategory->name));
             $i--;
         }
     }
     $container->addPage(new Zend_Navigation_Page_Uri(array('label' => 'Каталог', 'uri' => '/admin/categories/', 'order' => $i)));
     return $container;
 }
Пример #15
0
 public function testGetChildrenShouldReturnTheCurrentPage()
 {
     $container = new Zend_Navigation();
     $page = Zend_Navigation_Page::factory(array('type' => 'uri'));
     $container->addPage($page);
     $this->assertEquals($page, $container->getChildren());
 }
Пример #16
0
 public function renderTabs()
 {
     $n = new Zend_Navigation();
     foreach ($this->pages as $page) {
         $p = new Zend_Navigation_Page_Mvc(array('module' => $this->_request->getModuleName(), 'action' => 'index', 'controller' => $this->_request->getControllerName(), 'label' => $page->getTitle(), 'params' => array('page_id' => $page->getId()), 'route' => 'inside-pages'));
         $p->setActive($this->getPageId() == $page->getId());
         $n->addPage($p);
     }
     $h = new Am_View_Helper_AdminTabs();
     $h->setView($this->view);
     return $h->adminTabs($n);
 }
$lvl0 = new Zend_Navigation();
$lvl1 = new Zend_Navigation_Page_Mvc();
$lvl1->setLabel('Vakantiewoning huren')->setModule('rent')->setController('index')->setAction('index')->setRoute('module');
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Vakantiewoningen')->setModule('rent')->setController('index')->setAction('index')->setRoute('module_controller');
$lvl3 = new Zend_Navigation_Page_Mvc();
$lvl3->setLabel('Vakantiewoning informatie')->setModule('holidayhome')->setController('index')->setAction('index')->setRoute('module_controller_action');
$lvl2->addPage($lvl3);
$lvl1->addPage($lvl2);
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Bestemmingen')->setModule('rent')->setController('destination')->setAction('index')->setRoute('module_controller');
$lvl1->addPage($lvl2);
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Klantenservice')->setModule('customerservice')->setController('index')->setAction('index')->setRoute('module');
$lvl1->addPage($lvl2);
$lvl0->addPage($lvl1);
$lvl1 = new Zend_Navigation_Page_Mvc();
$lvl1->setLabel('Vakantiewoning verhuren')->setModule('rentout')->setController('index')->setAction('index')->setRoute('module');
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Vakantiewoningen')->setModule('rentout')->setController('index')->setAction('index')->setRoute('module_controller');
$lvl1->addPage($lvl2);
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Informatie')->setModule('rentout')->setController('information')->setAction('index')->setRoute('module_controller');
$lvl1->addPage($lvl2);
$lvl0->addPage($lvl1);
$lvl1 = new Zend_Navigation_Page_Mvc();
$lvl1->setLabel('Mijn account')->setModule('user')->setController('myaccount')->setAction('index')->setRoute('module_controller');
$lvl2 = new Zend_Navigation_Page_Mvc();
$lvl2->setLabel('Mijn gegevens')->setModule('user')->setController('myaccount')->setAction('index')->setRoute('module_controller');
$lvl1->addPage($lvl2);
$lvl2 = new Zend_Navigation_Page_Mvc();
Пример #18
0
 private function menu()
 {
     //Get bootstrap
     $bootstrap = Zend_Controller_Front::getInstance()->getParam("bootstrap");
     $db = $bootstrap->getPluginResource('db')->getDbAdapter();
     $auth = Zend_Auth::getInstance();
     $authArray = $auth->getIdentity();
     $roleid = $authArray['role_id'];
     $userid = $authArray['user_id'];
     //Get The Menu Items from Database
     $select = $db->select();
     $select->from(array('sm' => 'mst_user_method'), array('submenu_id' => 'sm.id', 'submenu_name' => 'sm.name', 'submenu_url' => 'sm.url_path'))->joinLeft(array('mm' => 'mst_user_menu_main'), 'sm.menu_id = mm.id', array('mainmenu_id' => 'mm.id', 'mainmenu_name' => 'mm.name', 'mainmenu_url' => 'mm.url_path'))->where('sm.show_in_menu = ?', 'Y')->where('sm.is_active = ?', 'Y')->where('mm.is_active = ?', 'Y');
     if ($roleid != Rgm_Constants::ROLE_ADMIN) {
         $select->where('sm.id IN (?)', new Zend_Db_Expr("select mst_user_method_vs_user.method_id from mst_user_method_vs_user where user_id=" + $userid));
     }
     $select->order('mm.sort_order ASC');
     $select->order('sm.sort_order ASC');
     $stmt = $select->query();
     $menuRows = $stmt->fetchAll();
     $container = new Zend_Navigation();
     //---------Get The Active Menu And Sub Menu Item----------------
     $activeIdmm = 0;
     $activeIdsm = 0;
     $menuIdSession = new Zend_Session_Namespace();
     if (!$this->getRequest()->isXmlHttpRequest()) {
         if ($this->getRequest()->getParam('mm_id')) {
             //Main menuId
             $activeIdmm = $this->getRequest()->getParam('mm_id');
         } else {
             if (isset($menuIdSession->Active_Main_Menu_id)) {
                 $activeIdmm = $menuIdSession->Active_Main_Menu_id;
             }
         }
         if ($this->getRequest()->getParam('sm_id')) {
             //Main menuId
             $activeIdsm = $this->getRequest()->getParam('sm_id');
         } else {
             if (isset($menuIdSession->Aactive_Sub_Menu_Id)) {
                 $activeIdsm = $menuIdSession->Aactive_Sub_Menu_Id;
             }
         }
         $menuIdSession->Active_Main_Menu_id = $activeIdmm;
         $menuIdSession->Aactive_Sub_Menu_Id = $activeIdsm;
     }
     if ($menuRows) {
         $tmpMainMenuId = 0;
         $tmpMainMenuPage = null;
         $tmpSubMenuPage = null;
         $tmpActive = 0;
         foreach ($menuRows as $r) {
             if ($tmpMainMenuId != $r['mainmenu_id']) {
                 //New Main Menu Item
                 $tmpMainMenuId = $r["mainmenu_id"];
                 //Add previously created main menu page to container;
                 if ($tmpMainMenuPage != null) {
                     $container->addPage($tmpMainMenuPage);
                 }
                 if ($r["mainmenu_id"] == $activeIdmm) {
                     $tmpActive = 1;
                 } else {
                     $tmpActive = 0;
                 }
                 $tmpMainMenuPage = Zend_Navigation_Page::factory(array('id' => 'mm' . $r["mainmenu_id"], 'label' => $r["mainmenu_name"], 'uri' => $r["mainmenu_url"] == null ? "#" : $r["mainmenu_url"] . '?mm_id=' . $r["mainmenu_id"] . '&sm_id=' . $r["submenu_id"], 'active' => $tmpActive));
             }
             //Create sub menu
             if ($r["submenu_id"] == $activeIdsm) {
                 $tmpActive = 1;
             } else {
                 $tmpActive = 0;
             }
             $tmpSubMenuPage = Zend_Navigation_Page::factory(array('id' => 'sm' . $r["submenu_id"], 'label' => $r["submenu_name"], 'uri' => $r["submenu_url"] == null ? "#" : $r["submenu_url"] . '?sm_id=' . $r["submenu_id"], 'active' => $tmpActive));
             //Add it to mainMenuPage
             $tmpMainMenuPage->addPage($tmpSubMenuPage);
         }
         //Last page
         if ($tmpMainMenuPage != null) {
             $container->addPage($tmpMainMenuPage);
         }
     }
     $view = $bootstrap->bootstrap('view')->getResource('view');
     $view->navigation($container);
 }
 /**
  * Set navigation in layout
  * @return Zend_View
  */
 protected function _initNavigation()
 {
     $this->bootstrap('layout');
     $layout = $this->getResource('layout');
     $view = $layout->getView();
     $lvl0 = new Zend_Navigation();
     $lvl1 = new Zend_Navigation_Page_Mvc();
     $lvl1->setLabel('Vakantiewoning huren')->setModule('rent')->setController('index')->setAction('index')->setRoute('module');
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Vakantiewoningen')->setModule('rent')->setController('index')->setAction('index')->setRoute('module_controller');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Vakantiewoning informatie')->setModule('holidayhome')->setController('index')->setAction('show')->setRoute('module_controller_action');
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Bestemmingen')->setModule('rent')->setController('residence')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Klantenservice')->setModule('customerservice')->setController('index')->setAction('index')->setRoute('module');
     $lvl1->addPage($lvl2);
     $lvl0->addPage($lvl1);
     $lvl1 = new Zend_Navigation_Page_Mvc();
     $lvl1->setLabel('Vakantiewoning verhuren')->setModule('rentout')->setController('index')->setAction('index')->setRoute('module');
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Vakantiewoningen')->setModule('rentout')->setController('index')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Informatie')->setModule('rentout')->setController('information')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl0->addPage($lvl1);
     $lvl1 = new Zend_Navigation_Page_Mvc();
     $lvl1->setLabel('Mijn account')->setModule('user')->setController('myaccount')->setAction('index')->setRoute('module_controller');
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Mijn gegevens')->setModule('user')->setController('myaccount')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Gegevens aanpassen')->setModule('user')->setController('myaccount')->setAction('edit')->setRoute('module_controller_action');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Inloggen')->setModule('user')->setController('myaccount')->setAction('login')->setRoute('module_controller_action');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Uitloggen')->setModule('user')->setController('myaccount')->setAction('logout')->setRoute('module_controller_action');
     $lvl1->addPage($lvl2);
     $lvl0->addPage($lvl1);
     $lvl1 = new Zend_Navigation_Page_Mvc();
     $lvl1->setLabel('Algemene informatie')->setModule('main')->setController('contact')->setAction('index')->setRoute('module_controller');
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Sitemap')->setModule('main')->setController('sitemap')->setAction('index')->setRoute('module_controller_action');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Over ons')->setModule('main')->setController('aboutus')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Contact')->setModule('main')->setController('contact')->setAction('index')->setRoute('module_controller');
     $lvl1->addPage($lvl2);
     $lvl0->addPage($lvl1);
     $lvl1 = new Zend_Navigation_Page_Mvc();
     $lvl1->setLabel('Beheer')->setModule('admin')->setController('index')->setAction('index')->setRoute('module');
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Financieel')->setModule('holidayhome')->setController('index')->setAction('financial')->setRoute('module_controller_action');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Vakantiewoningen')->setModule('holidayhome')->setController('index')->setAction('financial')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Reserveringskosten')->setModule('holidayhome')->setController('charges')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Per nacht" toevoegen')->setModule('holidayhome')->setController('chargenight')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Per nacht" aanpassen')->setModule('holidayhome')->setController('chargenight')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Per reservering" toevo...')->setModule('holidayhome')->setController('chargereservation')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Per reservering" aanp...')->setModule('holidayhome')->setController('chargereservation')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Optioneel" toevoegen')->setModule('holidayhome')->setController('chargeoptional')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('"Optioneel" aanpassen')->setModule('holidayhome')->setController('chargeoptional')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Extra uitgaven')->setModule('holidayhome')->setController('invoicecharge')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Toevoegen')->setModule('holidayhome')->setController('invoicecharge')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Aanpassen')->setModule('holidayhome')->setController('invoicecharge')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Percentages')->setModule('holidayhome')->setController('percentages')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Week toevoegen')->setModule('holidayhome')->setController('percentageweek')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Week aanpassen')->setModule('holidayhome')->setController('percentageweek')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Dag toevoegen')->setModule('holidayhome')->setController('percentageday')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Dag aanpassen')->setModule('holidayhome')->setController('percentageday')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Vakantiewoningen')->setModule('holidayhome')->setController('index')->setAction('admin')->setRoute('module_controller_action');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Vakantiewoning')->setModule('holidayhome')->setController('index')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Woning toevoegen')->setModule('holidayhome')->setController('index')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Woning aanpassen')->setModule('holidayhome')->setController('index')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel("Foto's")->setModule('holidayhome')->setController('photo')->setAction('index')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Foto toevoegen')->setModule('holidayhome')->setController('photo')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Foto aanpassen')->setModule('holidayhome')->setController('photo')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel("Informatie email")->setModule('holidayhome')->setController('infomail')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel("Commentaar")->setModule('holidayhome')->setController('comment')->setAction('index')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Commentaar toevoegen')->setModule('holidayhome')->setController('comment')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Commentaar aanpassen')->setModule('holidayhome')->setController('comment')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel("Bed aantallen")->setModule('holidayhome')->setController('bedamount')->setAction('index')->setRoute('module_controller_action_home');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Aantal toevoegen')->setModule('holidayhome')->setController('bedamount')->setAction('new')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Aantal aanpassen')->setModule('holidayhome')->setController('bedamount')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Gebruikers')->setModule('user')->setController('index')->setAction('admin')->setRoute('module_controller_action');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Gebruiker toevoegen')->setModule('user')->setController('index')->setAction('new')->setRoute('module_controller_action');
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Gebruiker aanpassen')->setModule('user')->setController('index')->setAction('edit')->setRoute('module_controller_action');
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Eigenaren')->setModule('user')->setController('owner')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Eigenaar toevoegen')->setModule('user')->setController('owner')->setAction('new')->setRoute('module_controller_action_showOnActive');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Eigenaar aanpassen')->setModule('user')->setController('owner')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Reserveren')->setModule('reservation')->setController('index')->setAction('admin')->setRoute('module_controller_action');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Reserverings data')->setModule('reservation')->setController('date')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Maand-data aanpassen')->setModule('reservation')->setController('date')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Reserveringen')->setModule('reservation')->setController('reservation')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Reservering toevoegen')->setModule('reservation')->setController('reservation')->setAction('new')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Reservering aanpassen')->setModule('reservation')->setController('reservation')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Reserveringen')->setModule('reservation')->setController('reservation')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Blokkeringen')->setModule('reservation')->setController('block')->setAction('admin')->setRoute('module_controller_action_home');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Blokkering aanpassen')->setModule('reservation')->setController('block')->setAction('edit')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Blokkering toevoegen')->setModule('reservation')->setController('block')->setAction('new')->setRoute('module_controller_action_home');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Klantenservice')->setModule('customerservice')->setController('index')->setAction('index')->setRoute('module');
     $lvl1->addPage($lvl2);
     $lvl2 = new Zend_Navigation_Page_Mvc();
     $lvl2->setLabel('Systeem')->setModule('homemanagement')->setController('charges')->setAction('admin')->setRoute('module_controller_action');
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Reserveringskosten')->setModule('homemanagement')->setController('charges')->setAction('admin');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Nacht" toevoegen')->setModule('homemanagement')->setController('chargenight')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Nacht" Aanpassen')->setModule('homemanagement')->setController('chargenight')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Reservering" toevoegen')->setModule('homemanagement')->setController('chargereservation')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Reservering" Aanpassen')->setModule('homemanagement')->setController('chargereservation')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Optioneel" toevoegen')->setModule('homemanagement')->setController('chargeoptional')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('"Optioneel" aanpassen')->setModule('homemanagement')->setController('chargeoptional')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Bedden')->setModule('homemanagement')->setController('bed')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Bed aanpassen')->setModule('homemanagement')->setController('bed')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Bed toevoegen')->setModule('homemanagement')->setController('bed')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Kenmerken')->setModule('homemanagement')->setController('options')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Kenmerk toevoegen')->setModule('homemanagement')->setController('option')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Kenmerk aanpassen')->setModule('homemanagement')->setController('option')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Kenmerk-categorie toev...')->setModule('homemanagement')->setController('optioncategory')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Kenmerk-categorie aan...')->setModule('homemanagement')->setController('optioncategory')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Categorieen')->setModule('homemanagement')->setController('category')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Categorie toevoegen')->setModule('homemanagement')->setController('category')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Categorie aanpassen')->setModule('homemanagement')->setController('category')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Geografisch')->setModule('homemanagement')->setController('geo')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Land toevoegen')->setModule('homemanagement')->setController('country')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Land aanpassen')->setModule('homemanagement')->setController('country')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Regio toevoegen')->setModule('homemanagement')->setController('region')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Regio aanpassen')->setModule('homemanagement')->setController('region')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Plaats toevoegen')->setModule('homemanagement')->setController('city')->setAction('new')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Plaats aanpassen')->setModule('homemanagement')->setController('city')->setAction('edit')->setRoute('module_controller_action');
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl3 = new Zend_Navigation_Page_Mvc();
     $lvl3->setLabel('Publiek')->setModule('public')->setController('country')->setAction('admin')->setRoute('module_controller_action');
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Landen')->setModule('public')->setController('country')->setAction('admin')->setRoute('module_controller_action');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Land toevoegen')->setModule('public')->setController('country')->setAction('new')->setRoute('module_controller_action');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Land aanpassen')->setModule('public')->setController('country')->setAction('edit')->setRoute('module_controller_action');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl4 = new Zend_Navigation_Page_Mvc();
     $lvl4->setLabel('Talen')->setModule('public')->setController('lang')->setAction('admin')->setRoute('module_controller_action');
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Land toevoegen')->setModule('public')->setController('lang')->setAction('new')->setRoute('module_controller_action');
     $lvl4->addPage($lvl5);
     $lvl5 = new Zend_Navigation_Page_Mvc();
     $lvl5->setLabel('Land aanpassen')->setModule('public')->setController('lang')->setAction('edit')->setRoute('module_controller_action');
     $lvl4->addPage($lvl5);
     $lvl3->addPage($lvl4);
     $lvl2->addPage($lvl3);
     $lvl1->addPage($lvl2);
     $lvl0->addPage($lvl1);
     /**
      * Testing
      */
     /**
      * Specific navigations
      */
     $view->loginMenu = $lvl0->findOneByLabel('Mijn account');
     $view->adminMenu = $lvl0->findOneByLabel('Beheer');
     /**
      * view
      */
     $view->navigation($lvl0);
     return $view;
 }
Пример #20
0
 /**
  * Add a normalized page to the navigation using parent::addPage()
  * This needs to wrapped so that methods like createNavigationFromFilter() can add pages directly using
  * the parent class method.
  * 
  * @param  Zend_Navigation_Page|array|Zend_Config $normalizedPage  normalized page to add
  * @return Zend_Navigation_Container                     fluent interface,
  *                                                       returns self
  * @throws Zend_Navigation_Exception                     if page is invalid     
  */
 public function baseAddNormalizedPage($normalizedPage)
 {
     // the page is assumed to be normalized already.
     return parent::addPage($normalizedPage);
 }
Пример #21
0
 private function addCurrentPageUnregistered(Zend_Navigation $nav, Zend_Controller_Request_Abstract $request)
 {
     if ($nav->findBy('id', 'mii-' . $request->getParam('mid'))) {
         return;
     }
     $session = new Zend_Session_Namespace('previousPage');
     if (strcmp(strtolower($request->getActionName()), 'logout') === 0) {
         $session->unsetAll();
     }
     #$session->previousPage = null;
     $previousPage = $session->previousPage;
     $currentPage = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
     $navItem = $nav->findAllBy('active', true);
     if (count($navItem) == 0) {
         $navItem = array('module' => strtolower($request->getModuleName()), 'controller' => strtolower($request->getControllerName()), 'action' => strtolower($request->getActionName()), 'label' => ucfirst(strtolower($request->getActionName())), 'title' => ucfirst(strtolower($request->getActionName())), 'resource' => strtolower($request->getModuleName() . ':' . $request->getControllerName()), 'privilege' => strtolower($request->getActionName()), 'id' => 0, 'miid' => 0, 'visible' => false, 'active' => true);
         if (is_null($previousPage)) {
             $nav->addPage($navItem);
         } else {
             $navCurrentItem = $nav->findBy('id', $session->miid);
             $navCurrentItem->addPage($navItem);
         }
     } else {
         $session->previousPage = $currentPage;
         $navCurrentItem = $nav->findBy('active', true);
         $session->miid = $navCurrentItem->id;
     }
 }
Пример #22
0
 protected function _initNavigation()
 {
     $this->bootstrap('log');
     $this->bootstrap('layout');
     $this->bootstrap('acl');
     $this->bootstrap('session');
     $this->bootstrap('plugins');
     $layout = $this->getResource('layout');
     $view = $layout->getView();
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml');
     $navigation = new Zend_Navigation($config);
     $baseSettings = $this->getConfig()->settings;
     if (isset($baseSettings->pluginInterface)) {
         $pluginInterface = $baseSettings->pluginInterface;
         $pluginPages = array();
         $pluginInstances = KalturaPluginManager::getPluginInstances($pluginInterface);
         foreach ($pluginInstances as $pluginInstance) {
             /* @var $pluginInstance KalturaPlugin */
             foreach ($pluginInstance->getApplicationPages() as $pluginPage) {
                 $pluginPages[] = $pluginPage;
             }
         }
         foreach ($pluginPages as $pluginPage) {
             if (!$pluginPage instanceof KalturaApplicationPlugin) {
                 KalturaLog::err("Class [" . get_class($pluginPage) . "] is not instance of KalturaApplicationPlugin");
                 continue;
             }
             $resource = get_class($pluginPage);
             $acl = Zend_Registry::get('acl');
             $acl->addResource(new Zend_Acl_Resource($resource));
             if (!$pluginPage->accessCheck(Infra_AclHelper::getCurrentPermissions())) {
                 $acl->deny(Infra_AclHelper::getCurrentRole(), $resource);
                 KalturaLog::err("Class [" . get_class($pluginPage) . "] requires permissions [" . print_r($pluginPage->getRequiredPermissions(), true) . "]");
                 continue;
             }
             if (!$pluginPage->isLoginRequired()) {
                 Infra_AuthPlugin::addToWhitelist('plugin/' . $pluginPage->getNavigationActionName());
             }
             $acl->allow(Infra_AclHelper::getCurrentRole(), $resource);
             $menuPage = null;
             if ($pluginPage->getNavigationRootLabel()) {
                 $menuPage = $navigation->findOneBy('label', $pluginPage->getNavigationRootLabel());
                 if (!$menuPage) {
                     $navigation->addPage(array('label' => $pluginPage->getNavigationRootLabel(), 'controller' => 'plugin', 'action' => get_class($pluginPage)));
                     $menuPage = $navigation->findOneBy('label', $pluginPage->getNavigationRootLabel());
                 }
             }
             $subMenuPage = null;
             if ($pluginPage->getNavigationActionLabel()) {
                 $subMenuPage = $navigation->findOneBy('label', $pluginPage->getNavigationActionLabel());
                 if (!$subMenuPage) {
                     $navigation->addPage(array('label' => $pluginPage->getNavigationActionLabel(), 'controller' => 'plugin', 'action' => get_class($pluginPage)));
                 }
                 $subMenuPage = $navigation->findOneBy('label', $pluginPage->getNavigationActionLabel());
             }
             if ($menuPage && $subMenuPage) {
                 $subMenuPage->setParent($menuPage);
             }
         }
     }
     $this->checkAclForNavigation($navigation);
     $view->navigation($navigation);
 }
Пример #23
0
 public function getNavigation()
 {
     $this->view->navigation = $navigation = new Zend_Navigation();
     $navigation->addPage(array('label' => 'Browse Videos', 'route' => 'video_general', 'action' => 'browse', 'controller' => 'index', 'module' => 'video'));
     if (Engine_Api::_()->user()->getViewer()->getIdentity()) {
         $navigation->addPages(array(array('label' => 'My Videos', 'route' => 'video_general', 'action' => 'manage', 'controller' => 'index', 'module' => 'video'), array('label' => 'Post New Video', 'route' => 'video_general', 'action' => 'create', 'controller' => 'index', 'module' => 'video')));
     }
     return $navigation;
 }