protected function _preDispatch() { //set the area in the design model $design = App_Main::getDesign()->setArea($this->_currentArea); $website = $this->_getWebsite(); $namespace = $this->getLayout()->getArea(); App_Main::getSingleton('core/session', array('name' => $this->_currentArea))->start(); //load the website based configs only on frontend if ($this->_currentArea == 'frontend') { $website->loadFromRequestUrl(); //switch the theme based on website's theme if configured if ($website->getTheme() != $design->getTheme() && !$design->isThemeLocked()) { $design->setTheme($website->getTheme()); } if ($this->_getWebsite()->getConfig('session-log-visitors')) { App_Main::getSingleton('visitor/visitor')->initByRequest(); } } //set the theme from request or session if ($this->getRequest()->getParam('_theme') || $this->_getSession()->getCustomTheme()) { if ($theme = $this->getRequest()->getParam('_theme')) { $this->_getSession()->setCustomTheme($theme); } else { $theme = $this->_getSession()->getCustomTheme(); } $design->setTheme($theme)->lockTheme(); } $this->loadLayout(); //@#ToDO update layout for the current request $this->_updatelayout(); //init translator if ($this->_currentArea == 'frontend' && $this->_getWebsite()->getConfig('fontend_translation_enabled')) { App_Main::getTranslator()->init($this->_currentArea); } return $this; }
/** * Translate wrapper method to translate block sentence */ public function __() { $args = func_get_args(); return App_Main::getTranslator()->translate($args); }