private function route() { // separate url and values // look for url in page.xml $tempArray = $this->parseUrl(status::url()); status::set('url', $tempArray['url']); status::set('val', $tempArray['val']); // add values to val-parameter status::set('path', $tempArray['path']); // add values to val-parameter //echoall($tempArray); // routable url found if (status::url()) { if ($newVal = OLIVRoute::getUrl(status::url())) { status::set('url', $newVal); } else { OLIVError::fire("route.php::route - rescan route information"); } } else { // use 404 page or if not defined use index page if (system::OLIV_404_PAGE()) { status::set('url', system::OLIV_404_PAGE()); } else { status::set('url', system::OLIV_INDEX_PAGE()); } } // set page name in correct language status::set('OLIV_PAGE', system::OLIV_SITE_NAME() . " " . OLIVText::xml($this->getPageName(status::lang(), status::url()))); }
function __construct($header) { $this->content = OLIVModule::load_content($header); $pathActive = count(status::path()); // get path if (array_key_exists("path", $_SESSION)) { $path = $_SESSION['path']; } else { $path = array(); } // insert start page link if not active if ($path[0] != system::OLIV_INDEX_PAGE()) { $homePage = OLIVRoute::translateName(status::lang(), system::OLIV_INDEX_PAGE()); $newNode = $this->content->addChild("path_point", $homePage); $newNode->addAttribute("href", system::OLIV_INDEX_PAGE()); if ($pathActive == 0) { $newNode->addAttribute("class", "breadcrumb_active"); } else { $newNode->addAttribute("class", "breadcrumb"); } } // insert all links in hyrarchy $x = 1; foreach ($path as $page) { $pageName = OLIVRoute::translateName(status::lang(), $page); $newNode = $this->content->addChild("path_point", $pageName); $newNode->addAttribute("href", $page); if ($pathActive == $x) { $newNode->addAttribute("class", "breadcrumb_active"); } else { $newNode->addAttribute("class", "breadcrumb"); } $x++; } //echoall($this->content); $this->template = OLIVModule::load_template($header); }
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; }