コード例 #1
0
 /**
  * Вызывается при инициализации FrontController
  * Присваивает значения, необходимым переменным
  */
 public function init()
 {
     Yii::app()->eventManager->fire(YupeEvents::BEFORE_FRONT_CONTROLLER_INIT, new YupeControllerInitEvent($this, Yii::app()->getUser()));
     parent::init();
     Yii::app()->theme = $this->yupe->theme ?: 'default';
     $bootstrap = Yii::app()->getTheme()->getBasePath() . DIRECTORY_SEPARATOR . "bootstrap.php";
     if (is_file($bootstrap)) {
         require $bootstrap;
     }
 }
コード例 #2
0
 /**
  * Вызывается при инициализации FrontController
  * Присваивает значения, необходимым переменным
  */
 public function init()
 {
     Yii::app()->eventManager->fire(YupeEvents::BEFORE_FRONT_CONTROLLER_INIT, new YupeControllerInitEvent($this, Yii::app()->getUser()));
     parent::init();
     Yii::app()->theme = $this->yupe->theme ?: 'default';
     $this->mainAssets = Yii::app()->getTheme()->getAssetsUrl();
     $bootstrap = Yii::app()->getTheme()->getBasePath() . DIRECTORY_SEPARATOR . "bootstrap.php";
     if (is_file($bootstrap)) {
         require $bootstrap;
     }
     $this->metatitle = $this->yupe->siteName;
     $this->description = $this->yupe->siteDescription;
     $this->keywords = $this->yupe->siteKeyWords;
     $currency = isset($_COOKIE['currency']) ? (int) $_COOKIE['currency'] : 0;
     // Определяем выбранную валюту
     $this->_currentCurrency = $currency > 0 ? $currency : Yii::app()->getModule('realty')->defaultCurrency;
 }
コード例 #3
0
ファイル: BackController.php プロジェクト: alextravin/yupe
 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->yupe->getComponent('bootstrap');
     $this->layout = $this->yupe->getBackendLayoutAlias();
     $backendTheme = $this->yupe->backendTheme;
     $this->pageTitle = Yii::t('YupeModule.yupe', 'Yupe control panel!');
     if ($this->yupe->hidePanelUrls == WebModule::CHOICE_NO) {
         Yii::app()->getErrorHandler()->errorAction = '/yupe/backend/error';
     }
     Yii::app()->eventManager->fire(YupeEvents::BACKEND_CONTROLLER_INIT, new YupeControllerInitEvent($this, Yii::app()->getUser()));
     if ($backendTheme) {
         Yii::app()->theme = "backend_" . $backendTheme;
     } else {
         Yii::app()->theme = $this->yupe->theme;
     }
 }