public function __construct($params) { if (Vi_Registry::isRegistered('EDIT_LAYOUT_MODE')) { $this->_sampleMode = Vi_Registry::get('EDIT_LAYOUT_MODE'); } $this->_name = $params['name']; if (isset($params['title'])) { $this->_title = $params['title']; $this->_holderId = $params['holder_id']; } $this->_params = $params; $view = Vi_Layout::getMvcInstance()->getView(); $this->view = clone $view; $this->db = Vi_Registry::get('db'); $this->session = Vi_Registry::getSession(); $this->auth = Vi_Registry::getAuth(); $this->aclFront = Vi_Registry::getAclFront(); $this->aclAdmin = Vi_Registry::getAclAdmin(); $this->view->setEngine(clone $view->getEngine()); $this->_langCode = Vi_Language::getCurrentLangCode(); $config = Vi_Registry::getConfig(); $this->_compileDir = $config['viewConfig']['compile_dir']; $this->_cacheDir = $config['viewConfig']['cache_dir']; /* * set up dir for smarty * 'template_dir' => 'stickers/$stickerName', 'compile_dir' => 'tmp/compile/stickers/$stickerName/$langCode', 'cache_dir' => 'tmp/cache/stickers/$stickerName/$langCode', */ $this->view->setScriptPath('./'); $this->view->setCompilePath($config['viewConfig']['compile_dir']); $this->view->setCachePath($config['viewConfig']['cache_dir']); /* * call main funtion */ $this->_saveInfo['currentType'] = Vi_Language::$currentType; $this->_saveInfo['currentName'] = Vi_Language::$currentName; Vi_Language::$currentType = Vi_Language::TYPE_STICKER; Vi_Language::$currentName = $this->_name; $this->view->STICKER_URL = Vi_Registry::getBaseUrl() . "stickers/{$this->_name}/"; $this->view->HELPER_URL = $this->view->STICKER_URL . 'helpers/'; $this->init(); $this->run(); }