protected function initializeCulture() { $language = $this->getCurrentLanguage(); $this->languageId = $language["LID"]; $culture = Context\Culture::wakeUp($language["CULTURE_ID"]); $this->setContextCulture($culture, $language["LID"]); }
protected function initializeSite() { $request = $this->getRequest(); $currentDirectory = $request->getRequestedPageDirectory(); $currentDomain = $request->getHttpHost(false); $site = SiteTable::getByDomainAndPath($currentDomain, $currentDirectory); if ($site === false) { $siteList = SiteTable::getList(array('filter' => array('ACTIVE' => 'Y'), 'order' => array('DEF' => 'DESC', 'SORT' => 'ASC'), 'select' => array('*', 'ID' => 'LID'))); $site = $siteList->fetch(); } if ($site === false) { throw new SystemException("Site not found"); } $culture = Context\Culture::wakeUp($site["CULTURE_ID"]); if ($culture === null) { $culture = new Context\Culture(); } $this->site = new Context\Site($site); $this->site->setCulture($culture); $this->setContextCulture($culture, $this->site->getLanguage()); }
protected static function getCultureFormat(Context\Culture $culture) { return $culture->getDateTimeFormat(); }