public function init() { parent::init(); // do something on initialization //-> see Zend Framework // in our case we enable the layout engine (Zend_Layout) for all actions $this->enableLayout(); }
public function init() { parent::init(); Plugin::getEventManager()->trigger('controller.init', $this); $this->view->setScriptPath(array_merge($this->view->getScriptPaths(), array(PIMCORE_WEBSITE_PATH . '/views/scripts/', PIMCORE_WEBSITE_PATH . '/views/layouts/', PIMCORE_WEBSITE_PATH . '/views/scripts/coreshop/'))); $this->view->addHelperPath(CORESHOP_PATH . '/lib/CoreShop/View/Helper', 'CoreShop\\View\\Helper'); $this->session = $this->view->session = Tool::getSession(); /* if(!$this->session->country instanceof CoreShopCountry) { if($this->session->user instanceof \CoreShop\Plugin\User && count($this->session->user->getAddresses()) > 0) { $this->session->country = $this->session->user->getAddresses()->get(0)->getCountry(); } else $this->session->country = Tool::getCountry(); } */ if ($this->getParam("currency")) { if (Currency::getById($this->getParam("currency")) instanceof Currency) { $this->session->currencyId = $this->getParam("currency"); } } $this->view->country = Tool::getCountry(); $this->enableLayout(); $this->setLayout(Plugin::getLayout()); $this->prepareCart(); $this->view->isShop = true; }
public function init() { parent::init(); if ($this->view->editmode) { $this->enableLayout(); $this->setLayout("snippet"); } }
public function init() { parent::init(); $this->enableLayout(); // allow to override plugin views by website $this->view->setScriptPath(array_merge($this->view->getScriptPaths(), array(PIMCORE_WEBSITE_PATH . '/views/scripts/', PIMCORE_WEBSITE_PATH . '/views/layouts/', PIMCORE_WEBSITE_PATH . '/views/scripts/member/'))); $this->auth = \Zend_Auth::getInstance(); // TODO provide plugin translations to frontend $this->translate = $this->initTranslation(); $this->view->flashMessages = $this->_helper->flashMessenger->getMessages(); }
public function init() { parent::init(); $pimUser = false; if (\Pimcore\Tool::isFrontentRequestByAdmin()) { $pimUser = \Pimcore\Tool\Admin::getCurrentUser(); if ($pimUser) { //echo "IS ADMIN"; } } $identity = \Zend_Auth::getInstance()->getIdentity(); if (!$identity && !$pimUser or $this->getParam('oid') != $identity['oid']) { $this->redirect("/"); } else { // login ok } }
public function init() { parent::init(); if (file_exists(PIMCORE_WEBSITE_PATH . "/var/search/search.xml")) { $searchConf = new Zend_Config_Xml(PIMCORE_WEBSITE_PATH . "/var/search/search.xml"); if ($searchConf->search->frontend->enabled) { try { Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive()); $this->frontendIndex = Zend_Search_Lucene::open(SearchPhp_Plugin::getFrontendSearchIndex()); $this->categories = explode(",", $searchConf->search->frontend->categories); if ($searchConf->search->frontend->ignoreLanguage != '1') { $this->searchLanguage = $this->_getParam("language"); if (empty($this->searchLanguage)) { try { $this->searchLanguage = Zend_Registry::get("Zend_Locale"); } catch (Exception $e) { $this->searchLanguage = "en"; } } } else { $this->searchLanguage = null; } $this->fuzzySearch = false; if ($searchConf->search->frontend->fuzzySearch == '1') { $this->fuzzySearch = true; } if ($searchConf->search->frontend->ownHostOnly) { $this->ownHostOnly = true; } } catch (Exception $e) { //p_r($e); throw new Exception("could not open index"); } } else { throw new Exception("search frontend is not installed and enabled."); } } }
public function init() { parent::init(); //$this->view->layout()->setLayout('email'); }
public function init() { parent::init(); }
public function init() { parent::init(); $this->enableLayout(); }