prepareDataLang(); } if(!$page) exit; if(Config::_get("jumpOverEmptyPages") && $page->isEmpty()) { $subPages = $page->getSubPages(); if(count($subPages) > 0) { $page = $subPages[0]; } } if($page->id != $_REQUEST['id']) { loadClass("GUI"); GUI::_redirect(GUI::_formatUrl("page", "id=".$page->id), 301); } /*if(!$page->isOnline()) { if(isset($_SERVER['HTTP_REFERER'])) { if(strpos($_SERVER['HTTP_REFERER'], Config::_get("base")."/cms/") !== 0) { $page = getHomePage(); } } else { $page = getHomePage(); } if(!$page) exit; }*/ /*$output = ""; $useCache = Config::_get("useCache") && $page->useCache(); $useCache = false; if($useCache) { list($time, $cacheId, $queryString, $output) = $page->getOutput(); } if(!$output) { $output = GUI::_fetch("page.tpl", $page, false); if($useCache) { $page->setOutput($time, $cacheId, $queryString, $output); } } $output = GUI::_replaceNoCache($output, $page); print $output;*/ //$middleTime = microtime(true) - $startTime; GUI::_flush(); GUI::_display("page.tpl", $page); GUI::_flush(); $page->writeCache(); //$endTime = microtime(true) - $startTime; /*print "middle = $middleTime
"; print "end = $endTime
"; print "diff = ".($endTime - $middleTime);*/ $alert = $_REQUEST['alert']; if(!$alert) $alert = Session::_get("alert"); if($alert && strpos($alert, "lang") === 0) { print ''; Session::_clear("alert"); } function getHomePage() { loadClass("Platform"); $page = new Page(Platform::_getTopId()); $subPages = $page->getSubPages(); if(count($subPages) == 0) return null; return $subPages[0]; } ?>