Пример #1
0
 public function process($page)
 {
     global $_PLUGIN;
     //echoall($page);
     // call plugins
     //		$pageXml = olivxml_create($page,"page");
     if ($page) {
         $pageXml = OLIVPlugin::call(new simpleXmlElement($page), "render");
         //------------------------------------------------------------------------------
         // convert page xml to html
         if (sessionfile_exists(system::OLIV_TEMPLATE_PATH() . "post.xslt")) {
             $postStylesheet = sessionxml_load_file(system::OLIV_TEMPLATE_PATH() . "post.xslt");
         } else {
             OLIVError::fire("postprocessor.php::process - post.xslt file not found");
             die;
         }
         $htmlProcessor = new XSLTProcessor();
         $htmlProcessor->importStylesheet($postStylesheet);
         $pageString = $htmlProcessor->transformToXML($pageXml);
         //echoall($pageXml->asXML());
         //------------------------------------------------------------------------------
         // run markup parser
         $pageString = $this->markup($pageString);
         return $pageString;
     }
 }
Пример #2
0
 public function getSearch()
 {
     $content = new simpleXmlElement("<search></search>");
     if (argv::action() == "search") {
         OLIVPlugin::call($content, "search");
         status::set("search_result", $content);
     }
 }
Пример #3
0
 public static function call($page, $type)
 {
     global $_PLUGIN;
     // call xml render plugins
     // get plugin methods
     $methods = $_PLUGIN->XPath("//{$type}");
     $page = OLIVPlugin::parse_methods($page, $methods, $type);
     //------------------------------------------------------------------------------
     return $page;
 }
Пример #4
0
 public static function _load($pageName)
 {
     $xml = "";
     if (!$pageName) {
         $url = status::url();
         // if no url defined, user OLIV_INDEX_PAGE
         if (!$url) {
             $url = system::OLIV_INDEX_PAGE();
         }
         $pageName = strtolower($url);
         // set to lowercase
     }
     // create content path
     $path = system::OLIV_PAGE_PATH() . $pageName . "/" . $pageName . ".xml";
     if (sessionfile_exists($path)) {
         // load content xml
         $xml = sessionxml_load_file($path);
         //------------------------------------------------------------------------------
         // search for plugins and call methods
         if ($xml->content->include) {
             OLIVPlugin::call($xml->content, "page");
         }
         //------------------------------------------------------------------------------
         return $xml;
     } else {
         OLIVError::fire("page::load - page not found");
     }
     return FALSE;
 }