web/lib/Zend/Controller/Action/Helper/ContextSwitch.php
changeset 886 1e110b03ae96
parent 807 877f952ae2bd
child 1230 68c69c656a2c
equal deleted inserted replaced
885:2251fb41dbc7 886:1e110b03ae96
    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_Controller
    16  * @package    Zend_Controller
    17  * @subpackage Zend_Controller_Action_Helper
    17  * @subpackage Zend_Controller_Action_Helper
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 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: ContextSwitch.php 20096 2010-01-06 02:05:09Z bkarwin $
    20  * @version    $Id: ContextSwitch.php 24864 2012-06-02 00:51:50Z adamlundrigan $
    21  */
    21  */
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Controller_Action_Helper_Abstract
    24  * @see Zend_Controller_Action_Helper_Abstract
    25  */
    25  */
    30  *
    30  *
    31  * @uses       Zend_Controller_Action_Helper_Abstract
    31  * @uses       Zend_Controller_Action_Helper_Abstract
    32  * @category   Zend
    32  * @category   Zend
    33  * @package    Zend_Controller
    33  * @package    Zend_Controller
    34  * @subpackage Zend_Controller_Action_Helper
    34  * @subpackage Zend_Controller_Action_Helper
    35  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    35  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  */
    37  */
    38 class Zend_Controller_Action_Helper_ContextSwitch extends Zend_Controller_Action_Helper_Abstract
    38 class Zend_Controller_Action_Helper_ContextSwitch extends Zend_Controller_Action_Helper_Abstract
    39 {
    39 {
    40     /**
    40     /**
  1302     {
  1302     {
  1303         $controller = $this->getActionController();
  1303         $controller = $this->getActionController();
  1304         if (null === $controller) {
  1304         if (null === $controller) {
  1305             return array();
  1305             return array();
  1306         }
  1306         }
  1307         $action     = (string) $action;
       
  1308         $contextKey = $this->_contextKey;
  1307         $contextKey = $this->_contextKey;
  1309 
  1308 
  1310         if (!isset($controller->$contextKey)) {
  1309         if (!isset($controller->$contextKey)) {
  1311             return array();
  1310             return array();
  1312         }
  1311         }
  1313 
  1312 
  1314         if (null !== $action) {
  1313         if (null !== $action) {
       
  1314             $action = (string) $action;
  1315             if (isset($controller->{$contextKey}[$action])) {
  1315             if (isset($controller->{$contextKey}[$action])) {
  1316                 return $controller->{$contextKey}[$action];
  1316                 return $controller->{$contextKey}[$action];
  1317             } else {
  1317             } else {
  1318                 return array();
  1318                 return array();
  1319             }
  1319             }