Esempio n. 1
0
 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);
     }
 }