Exemple #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;
     }
 }
Exemple #2
0
 public function __construct()
 {
     global $_INDEX;
     if (!($_INDEX = sessionxml_load_file("index.idx"))) {
         $_INDEX = new simpleXmlElement("<index><root/></index>");
     }
     //		echoall($_INDEX);
 }
Exemple #3
0
 public static function load_xml($header, $path, $name, $root = "")
 {
     $filePath = system::OLIV_MODULE_PATH();
     // use module name from header
     if ($header) {
         $filePath .= (string) $header->name . "/";
     }
     $filePath .= $path;
     //TODO
     // load system file
     if (strtolower($root) == "system") {
         if (olivfile_exists($filePath . $name)) {
             return olivxml_load_file($filePath . $name);
         }
     } else {
         if (sessionfile_exists($filePath . $name)) {
             $xml = sessionxml_load_file($filePath . $name);
             // if access defined and write access -> enable editing
             if ($xml->access->getName()) {
                 // read access -> display
                 if (!OLIVRight::r($xml->access)) {
                     $xmlName = $xml->getName();
                     return new simpleXmlElement("<{$xmlName}/>");
                 } elseif (OLIVRight::w($xml->access)) {
                     OLIVText::writeSource($xml, $filePath . $name);
                 }
             }
             //TODO write imagesource
             //			OLIVImage::writeSource($xml,$filePath);
             return $xml;
         } else {
             OLIVError::warning("module.php::load_xml - {$root}{$filePath}{$name} not found");
         }
     }
 }
Exemple #4
0
    if ($sessionXml->system->children()) {
        foreach ($sessionXml->system->children() as $key => $value) {
            system::set($key, (string) $value);
        }
    } else {
        die("init.php - no session constant definitions found");
    }
} else {
    die("init.php - session.xml not found");
}
//------------------------------------------------------------------------------
// load session user rights
global $_access;
if (system::OLIV_ACCESS_FILE() == "local") {
    if (sessionfile_exists("access.xml")) {
        $_access = sessionxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
} else {
    if (olivfile_exists("access.xml")) {
        $_access = olivxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// set page arguments
// insert GET POST messages in argv
foreach ($_GET as $key => $value) {
Exemple #5
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;
 }
Exemple #6
0
 public function scan($lang)
 {
     $path = system::OLIV_PAGE_PATH() . "page.xml";
     if (sessionfile_exists($path)) {
         $pageXml = sessionxml_load_file($path);
         status::set("pages", $pageXml->define);
         status::set("pagestructure", $pageXml->structure);
         OLIVText::writeSource(status::pages(), $path);
     } else {
         OLIVError::fire("page::scan - page.xml not found -> rescan");
     }
 }