Example #1
0
 protected function _initNavigation()
 {
     $this->bootstrap('frontController');
     $pages = array(array('label' => 'Home', 'id' => 'index', 'action' => 'index', 'controller' => 'index'), array('label' => 'Entries', 'id' => 'entry', 'action' => 'index', 'controller' => 'entry', 'pages' => array(array('label' => 'New', 'id' => 'entry-new', 'action' => 'new', 'controller' => 'entry'), array('action' => 'get', 'controller' => 'entry', 'visible' => false), array('action' => 'edit', 'controller' => 'entry', 'visible' => false), array('action' => 'post', 'controller' => 'entry', 'visible' => false), array('action' => 'put', 'controller' => 'entry', 'visible' => false), array('action' => 'delete', 'controller' => 'entry', 'visible' => false))));
     $resource = new Zend_Application_Resource_Navigation(array('pages' => $pages));
     $resource->setBootstrap($this);
     return $resource->init();
 }
Example #2
0
 public function testInitializationReturnsNavigationObject()
 {
     $this->bootstrap->registerPluginResource('view');
     $resource = new Zend_Application_Resource_Navigation(array());
     $resource->setBootstrap($this->bootstrap);
     $test = $resource->init();
     $this->assertTrue($test instanceof Zend_Navigation);
     $this->bootstrap->unregisterPluginResource('view');
 }
Example #3
0
 protected function _initNavigation()
 {
     $this->bootstrap('view');
     $this->bootstrap('frontController');
     $this->bootstrap('acl');
     $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
     $resource = new Zend_Application_Resource_Navigation(array('pages' => $config->toArray()));
     $resource->setBootstrap($this);
     return $resource->init();
 }
Example #4
0
 public function init()
 {
     $options = $this->getOptions();
     switch ($options['type']) {
         case 'xml':
             // FIX FOR IIS CACHE FOLDER START
             //$config = new Zend_Config_Xml($options['file'], 'nav');
             $xml = file_get_contents($options['file']);
             $config = new Zend_Config_Xml($xml, 'nav');
             $this->_container = new Zend_Navigation($config);
             break;
     }
     parent::init();
 }
Example #5
0
 /**
  * Initialize navigation.
  *
  * @return Zend_Navigation
  */
 public function init()
 {
     $options = $this->getOptions();
     if (isset($options['configFile'])) {
         if (!$this->_container) {
             $config = $this->_loadConfig($options['configFile']);
             $this->_container = new Zend_Navigation($config);
         }
         $this->store();
         return $this->_container;
     } else {
         return parent::init();
     }
 }