web/lib/Zend/Application/Resource/Navigation.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Application
    16  * @package    Zend_Application
    17  * @subpackage Resource
    17  * @subpackage Resource
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Navigation.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @version    $Id$
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Application_Resource_ResourceAbstract
    24  * @see Zend_Application_Resource_ResourceAbstract
    25  */
    25  */
    31  *
    31  *
    32  * @uses       Zend_Application_Resource_ResourceAbstract
    32  * @uses       Zend_Application_Resource_ResourceAbstract
    33  * @category   Zend
    33  * @category   Zend
    34  * @package    Zend_Application
    34  * @package    Zend_Application
    35  * @subpackage Resource
    35  * @subpackage Resource
    36  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    37  * @author     Dolf Schimmel
    37  * @author     Dolf Schimmel
    38  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    38  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    39  */
    39  */
    40 class Zend_Application_Resource_Navigation
    40 class Zend_Application_Resource_Navigation
    41     extends Zend_Application_Resource_ResourceAbstract
    41     extends Zend_Application_Resource_ResourceAbstract
    55     public function init()
    55     public function init()
    56     {
    56     {
    57         if (!$this->_container) {
    57         if (!$this->_container) {
    58             $options = $this->getOptions();
    58             $options = $this->getOptions();
    59 
    59 
    60             if(isset($options['defaultPageType'])) {
    60             if (isset($options['defaultPageType'])) {
    61                 Zend_Navigation_Page::setDefaultPageType($options['defaultPageType']);
    61                 Zend_Navigation_Page::setDefaultPageType(
       
    62                     $options['defaultPageType']
       
    63                 );
    62             }
    64             }
    63             
    65 
    64             $pages = isset($options['pages']) ? $options['pages'] : array();
    66             $pages = isset($options['pages']) ? $options['pages'] : array();
    65             $this->_container = new Zend_Navigation($pages);
    67             $this->_container = new Zend_Navigation($pages);
    66         }
    68         }
    67 
    69 
    68         $this->store();
    70         $this->store();
    91      * @return void
    93      * @return void
    92      */
    94      */
    93     protected function _storeRegistry()
    95     protected function _storeRegistry()
    94     {
    96     {
    95         $options = $this->getOptions();
    97         $options = $this->getOptions();
    96         if(isset($options['storage']['registry']['key']) &&
    98         // see ZF-7461
    97            !is_numeric($options['storage']['registry']['key'])) // see ZF-7461
    99         if (isset($options['storage']['registry']['key'])
    98         {
   100             && !is_numeric($options['storage']['registry']['key'])
    99            $key = $options['storage']['registry']['key'];
   101         ) {
       
   102             $key = $options['storage']['registry']['key'];
   100         } else {
   103         } else {
   101             $key = self::DEFAULT_REGISTRY_KEY;
   104             $key = self::DEFAULT_REGISTRY_KEY;
   102         }
   105         }
   103 
   106 
   104         Zend_Registry::set($key,$this->getContainer());
   107         Zend_Registry::set($key, $this->getContainer());
   105     }
   108     }
   106 
   109 
   107     /**
   110     /**
   108      * Stores navigation container in the Navigation helper
   111      * Stores navigation container in the Navigation helper
   109      *
   112      *