コード例 #1
0
ファイル: WebCore.php プロジェクト: sb15/legacy-library
 public function preDispatch()
 {
     self::getDb()->query("SET time_zone = '+4:00'");
     $locale = 'ru';
     $translate = self::getBootstrap()->getResource('translate');
     if ($translate) {
         $locales = $translate->getList();
         if (in_array($this->_p('locale'), $locales)) {
             $translate->setLocale($this->_p('locale'));
             $locale = $this->_p('locale');
         }
     }
     if ($this->_p('disableLayout')) {
         $this->disableLayout();
     }
     if (Zend_Auth::getInstance()->hasIdentity()) {
         $identity = Zend_Auth::getInstance()->getIdentity();
         if (isset($identity->internalUserId)) {
             self::$_user = (object) User::getInstance()->getUserById($identity->internalUserId);
             $this->view->user = self::$_user;
         }
     }
     $this->view->headTitle()->setSeparator(' / ');
     $this->view->headTitle()->setDefaultAttachOrder(Zend_View_Helper_Placeholder_Container_Abstract::PREPEND);
     $this->view->assign('p', $this->_p());
 }