Esempio n. 1
0
 public function preDispatch()
 {
     $bootstrap = $this->getActionController()->getInvokeArg('bootstrap');
     $config = $bootstrap->getOptions();
     $module = $this->getRequest()->getModuleName();
     $controller = $this->getRequest()->getControllerName();
     $layoutScript = null;
     if (isset($config['resources']['layout']['admin']['layout']) && isset($config['admin']['controllers']) && in_array($controller, $config['admin']['controllers'])) {
         $layoutScript = $config['resources']['layout']['admin']['layout'];
     } elseif (isset($config['resources']['layout']['layout'])) {
         $layoutScript = $config['resources']['layout']['layout'];
     }
     if (isset($config['resources']['layout']['configs'][$layoutScript])) {
         Centurion_Config_Manager::set('resources.layout.configs', $config['resources']['layout']['configs'][$layoutScript]);
     }
     if (null !== $layoutScript) {
         //$this->getRequest()->setParam('_layout', $layoutScript);
         $this->getActionController()->getHelper('layout')->setLayout($layoutScript);
     }
 }
Esempio n. 2
0
 /**
  * Method to change of locale in follow tests to test the translation mechanism
  * @param string $locale
  */
 protected function _switchLocale($locale)
 {
     //Switch to required language
     Zend_Registry::get('Zend_Translate')->setLocale($locale);
     Zend_Locale::setDefault($locale);
     Zend_Registry::set('Zend_Locale', $locale);
     Centurion_Config_Manager::set(Translation_Traits_Common::DEFAULT_LOCALE_KEY, $locale);
     Zend_Controller_Front::getInstance()->getRouter()->setParam('language', $locale);
     Zend_Controller_Front::getInstance()->getRouter()->setGlobalParam('language', $locale);
 }