Beispiel #1
0
 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);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #3
0
 private static function render($content)
 {
     // edit mode if edit mode and permission
     if (argv::toolbox() == "article_edit") {
         $nodes = $content->XPath("//*[@textsource]");
         //echoall($nodes);
         for ($i = 0; $i < count($nodes); $i++) {
             // if source, make edit possible
             $tag = $nodes[$i]->getName();
             $text = (string) $nodes[$i];
             $source = (string) $nodes[$i]->attributes()->textsource;
             //TODO include javaScript content menu
             // include editor call <a>
             $nodes[$i][0] = "";
             $nodes[$i] = $nodes[$i][0]->addChild("a", $text);
             $nodes[$i]["title"] = "call editor for '{$source}'";
         }
     }
     return $content;
 }