function __construct($header) { //TODO use https when loggin in // use ssh for login // $host = "https://" . OLIV_SSH_HOST . "/" . OLIV_BASE . "index.php"; $host = "http://" . system::OLIV_SSH_HOST() . "/" . system::OLIV_BASE() . "index.php"; // load login content xml $this->content = OLIVModule::load_content($header); // select template for logged of not logged if (status::OLIV_USER()) { $header->param->template = "logged"; $this->content->username = OLIVUser::getName(status::OLIV_USER()); if (status::OLIV_SU()) { $this->content->su = status::OLIV_SU(); } else { $this->content->user_groups = OLIVUser::getGroupName(status::OLIV_USER()); } } else { // check if wrong login if (argv::action() == "login") { $header->param->template = "incorrect"; } } // load correct template $this->template = OLIVModule::load_template($header); }
public function __construct($header) { //TODO load toolbox system js and user js OLIVModule::load_javascript($header, "default"); OLIVModule::load_javascript($header); $contentName = argv::toolbox(); $this->content = OLIVModule::load_content($header, $contentName); // load template if content is loaded if ($this->content) { $this->template = OLIVModule::load_template($header); } }
public function __construct($header) { // create temporary content xml // name different if used with different templates $templateName = (string) $header->param->template; if ($templateName) { $this->content = new simpleXmlElement("<search_{$templateName}/>"); } else { $this->content = new simpleXmlElement("<search/>"); } $tempContent = OLIVModule::load_content($header); $this->template = OLIVModule::load_template($header); olivxml_insert($this->content, $tempContent); olivxml_insert($this->content->search_result, status::search_result()); // add search result target page $this->content->target = $header->param->target; }
public function __construct($header) { global $_argv; // status parameter found $status = (string) $header->param->status; if ($articleParam = status::$status()) { //TODO retranslate article name $header->param->content = $articleParam; } // load content $article = OLIVModule::load_content($header); // check if content exist // set article and content to "error_no_article" article if (!$article) { $article = OLIVModule::load_content($header, "error_no_article"); if (!$article) { die("no article error page defined"); } $article->content->articlename = (string) $header->param->content; // $article->argv->source = "sourcePath"; } // create edit frame $editStruct = new simpleXmlElement("<structure><article id='article_edit'/></structure>"); olivxml_insert($editStruct->article, $article->structure); // set article $this->content = $article; //TODO insert edit frame if toolbox = article_edit // set article for editing if (argv::toolbox() == "article_edit") { unset($this->content->structure); olivxml_insert($this->content, $editStruct, "ALL"); } // combine article $this->create(); // check activities $this->activities($header, $this->content); // add source and textname attribute recursive if ($article) { // get article languages $langs = OLIVText::getLanguages($article); olivxml_insert($article, OLIVLang::selector($langs), "ALL"); // load central article template // $this->template = OLIVModule::load_template($header,"default"); $this->template = OLIVModule::load_template($header); } }
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 getContentDefine($mod, $name) { if ($mod and $name) { $modules = system::modules(); $header = $modules[$mod]; // module header found if ($header) { $content = OLIVModule::load_content($header, $name); if ($content) { return $content->define; } } } }
public function __construct($header) { $this->template = OLIVModule::load_template($header); $this->content = OLIVModule::load_content($header); $this->calculate(); }