fragments[$region] = $content; } public function getRegionContent($region) { if(isset($this->fragments[$region])) return (string) $this->fragments[$region]; return NULL; } protected function addBaseData(\MCMS\Interfaces\iSystem $system, $siteId) { $this->setRegionContent('TITLE', $system->getSiteParam($siteId, '', 'title', 'Unnamed Page')); $this->setRegionContent('DESC', $system->getSiteParam($siteId, '', 'layout_desc', '')); $this->setRegionContent('KEYWORDS', $system->getSiteParam($siteId, '', 'layout_tags', '')); $this->setRegionContent('LANG', $system->getActiveLocale()); } public function getDocument($media, \MCMS\Response $response = NULL) { $system = \MCMS\System::getInstance(); $db = $system->getDB(); $agent = $system->getRequest()->getUserAgent(); $site = $db->getObjectP("SELECT * FROM websites WHERE id=?", array($system->getSiteId())); $this->setRegionContent('TITLE', $system->getSiteParam($system->getSiteId(), '', 'title', 'Unnamed Page')); $this->setRegionContent('DESC', $system->getSiteParam($system->getSiteId(), '', 'layout_desc', '')); $this->setRegionContent('KEYWORDS', $system->getSiteParam($system->getSiteId(), '', 'layout_tags', '')); $this->setRegionContent('LANG', $system->getActiveLocale()); // start offline part if($site->online == 'offline') { $headdata = '' . htmlentities($this->getRegionContent('TITLE')) . ''; $headdata .= ""; $headdata .= ""; $headdata .= ""; $headdata .= ""; $headdata .= "\n"; return '' . $headdata . 'This page is offline ATM'; } // end offline part if(defined('_SERVICE_')) return $this->fragments['CONTENT']; $num = 0; $layout = NULL; if($media == 'error') { return $this->getRegionContent('ERROR'); } return $this->getRegionContent('CONTENT'); } }