/** * Get the website from the request path * * @return Core_Model_Website */ public function getWebsiteFromPath() { if (!$this->_websiteCode) { $this->_websiteCode = App_Main::getWebsite()->getCode(); } return $this->_websiteCode; }
protected function _getWebsite() { if (!$this->_website) { $this->_website = App_Main::getWebsite(); } return $this->_website; }
/** * Get the website language code * * @return string lang_code */ public function getLang() { if (!$this->hasData('lang')) { $this->setData('lang', App_Main::getWebsite()->getConfig('web-default-language')); } return $this->getData('lang'); }
public function getLocaleData($locale = null) { if (empty($locale)) { $locale = App_Main::getWebsite()->getLocale(); } if (!empty($this->_translate[$locale])) { return $this->_translate[$locale]; } return false; }
/** * Set the title of the HTML page * title prefix and suffix can be obtained from the main config object * * @param string $title * @param bool $addPrefix * @param bool $addSuffix * @return Page_Block_Html_Head */ public function setTitle($title, $addPrefix = true, $addSuffix = true) { $titleStr = ''; if ($addPrefix) { $titleStr .= App_Main::getWebsite()->getConfig('website-title-prefix') ? App_Main::getWebsite()->getConfig('website-title-prefix') : APP_Main::TITLE_PREFIX; } $titleStr .= $title; if ($addPrefix) { $titleStr .= App_Main::getWebsite()->getConfig('website-title-prefix') ? App_Main::getWebsite()->getConfig('website-title-suffix') : APP_Main::TITLE_SUFFIX; } $this->setData('title', $titleStr); return $this; }
/** * Get the website object instance * * @return Core_Model_Website */ private function getWebsite() { return App_Main::getWebsite(); }
/** * Get the email locale * * @return string locale */ public function getLocale() { if ($this->hasData('locale')) { return $this->getData('locale'); } return App_Main::getWebsite()->getLocale(); }
/** * * @return string locale */ public function getLocale() { if (is_null($this->_locale)) { $this->_locale = App_Main::getWebsite()->getLocale(); } return $this->_locale; }
/** * Initialization visitor data from request * * Used in event "controller_action_predispatch" * * @return Core_Model_Visitor */ public function initByRequest() { $this->setData($this->_getSession()->getVisitorData()); $this->initServerData(); if (!$this->getId()) { $this->setFirstVisitAt(now()); $this->setIsNewVisitor(true); $this->setWebsiteId(App_Main::getWebsite()->getId()); $this->save(); } return $this; }
/** * Get the cookie lifetime * * @return int */ public function getLifetime() { $lifetime = $this->_lifetime ? $this->_lifetime : App_Main::getWebsite()->getConfig('session-cookie-lifetime'); return !is_numeric($lifetime) ? self::COOKIE_LIFETIME : $lifetime; }