Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 protected function _getWebsite()
 {
     if (!$this->_website) {
         $this->_website = App_Main::getWebsite();
     }
     return $this->_website;
 }
Esempio n. 3
0
 /**
  * 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');
 }
Esempio n. 4
0
 public function getLocaleData($locale = null)
 {
     if (empty($locale)) {
         $locale = App_Main::getWebsite()->getLocale();
     }
     if (!empty($this->_translate[$locale])) {
         return $this->_translate[$locale];
     }
     return false;
 }
Esempio n. 5
0
 /**
  * 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;
 }
Esempio n. 6
0
 /**
  * Get the website object instance 
  *  
  * @return Core_Model_Website 
  */
 private function getWebsite()
 {
     return App_Main::getWebsite();
 }
Esempio n. 7
0
 /**
  * Get the email locale
  * 
  * @return string locale 
  */
 public function getLocale()
 {
     if ($this->hasData('locale')) {
         return $this->getData('locale');
     }
     return App_Main::getWebsite()->getLocale();
 }
Esempio n. 8
0
 /**
  *
  * @return string locale 
  */
 public function getLocale()
 {
     if (is_null($this->_locale)) {
         $this->_locale = App_Main::getWebsite()->getLocale();
     }
     return $this->_locale;
 }
Esempio n. 9
0
 /**
  * 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;
 }
Esempio n. 10
0
 /**
  * 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;
 }