public static function GetPage($a_id) { $id = Database::Escape($a_id); $result = Database::Query("SELECT * FROM `" . DB_TBL_PAGES . "` WHERE `id` = '" . $id . "'"); if (!$result->HasData()) { die('Unknown page id'); } self::$m_pagename = unserialize($result->GetValue('name')); $doc = unserialize($result->GetValue('compiled')); if (!$doc) { $compiler = new Compiler(); $doc = $compiler->CompilePage($id); } // Plugin Hook $data_object = new stdClass(); $data_object->doc = $doc; ObjMgr::GetPluginMgr()->ExecuteHook("On_PrepareTemplate", $data_object); // Title Content::AddTitle($doc, Locales::GetConstString("PAGE_TITLE", NULL, self::$m_pagename[Locales::$m_locale])); return $doc->getHtml(); }
public function Build($a_node) { // Get all elements $nodes = $a_node->getElementsByTag('*', TEMPLATE_SEARCHMODE_UNMATCHED_RECURSIVE); foreach ($nodes as $node) { // Plugin Hook $data_object = new stdClass(); $data_object->node = $node; $data_object->moduleid = $this->m_moduleid; $data_object->ownerid = $this->m_ownerid; ObjMgr::GetPluginMgr()->ExecuteHook("On_Node_BuildTag_" . $node->tag(), $data_object); } }
public static function GetModule($a_id) { $id = Database::Escape($a_id); $module = new Module($id); $doc = $module->Build(); // Plugin Hook $data_object = new stdClass(); $data_object->doc = $doc; ObjMgr::GetPluginMgr()->ExecuteHook("On_PrepareTemplate", $data_object); $data = array(); $data['html'] = $doc->getHtml(); $data['module_data'] = self::$m_data['module_data']; return json_encode($data); }
StopWatch::Start(); ObjMgr::Initialize(); $pageid = isset($_GET['page']) ? $_GET['page'] : Content::GetDefaultPageId(); if (isset($_GET['logout']) && ObjMgr::GetAccount()->m_loggedin) { ObjMgr::GetAccount()->Logout(); } if (isset($_GET['locale'])) { Locales::SetUserLocale($_GET['locale']); } if (ObjMgr::GetAccount()->m_loggedin) { if (isset($_POST['action'])) { Compiler::$Mode = COMPILER_MODE_EDITOR; // Plugin Hook $data_object = new stdClass(); $data_object->post = $_POST; ObjMgr::GetPluginMgr()->ExecuteHook("On_PostAction_" . $_POST['action'], $data_object); switch ($_POST['action']) { // Saves module data case 'module_update': Editor::SaveModule($_POST['module_data']); exit; // Returns module html // Returns module html case 'module_query': print Editor::GetModule($_POST['module_id']); exit; // Creates module template // Creates module template case 'module_create': print Editor::CreateModule($_POST['module_type'], $_POST['module_template'], $_POST['module_name']); exit;