Beispiel #1
0
	function getPageStructure($path_to_structure) {
		global $current_user;
		$path_to_structure = Config::need('base_path') . 'structure' . DIRECTORY_SEPARATOR . $current_user->getTheme() . DIRECTORY_SEPARATOR . $path_to_structure;
		$path_to_default = Config::need('base_path') . 'structure' . DIRECTORY_SEPARATOR . $current_user->getTheme() . DIRECTORY_SEPARATOR . 'application.xml';
		StructureParser::clear();
		StructureParser::XMLToArray($path_to_structure, $path_to_default);
		$this->xsltFileName = StructureParser::getLayoutPath();
		$modules = StructureParser::getModules();
		return $modules;
	}
Beispiel #2
0
    Request::initialize();
    // авторизуем пользователя
    $current_user = new CurrentUser();
    // выполняем модули записи, если был соответствующий POST запрос
    if (Request::post('writemodule')) {
        PostWrite::process(Request::post('writemodule'));
    }
    // запускаем обработку страницы
    $page = new PageConstructor(Request::$structureFile);
    @ob_end_clean();
    echo $page->process();
} catch (Exception $e) {
    if ($dev_mode) {
        $errorString = $e->getMessage();
        $errorDescription = '[' . $e->getFile() . ':' . $e->getLine() . '][' . $e->getCode() . ']';
        $errorDescription .= '<br/><pre>' . $e->getTraceAsString() . '</pre>';
    } else {
        $errorDescription = '';
        $errorString = $e->getMessage();
    }
    $errorCode = $e->getCode();
    XMLClass::reinitialize();
    StructureParser::clear();
    $page = new PageConstructor('errors/p502.xml');
    @ob_end_clean();
    echo $page->process();
}
Log::timing('total');
if ($dev_mode) {
    echo Log::getHtmlLog();
}