function getHTML($id) { $U = new mUserdata(); $U = $U->getUDValue("selectedDomain"); if ($U == null) { $t = new HTMLTable(1); $t->addRow("Sie haben keine Domain ausgewählt.<br /><br />Bitte wählen Sie eine Domain im Domain-Plugin, indem Sie auf das graue Kästchen in der Liste auf der rechten Seite klicken."); return $t->getHTML(); } $Domain = new Domain($U); $Domain->loadMe(); $variables = array("domainTemplate", "contentTemplate", "naviTemplate", "pageTemplate"); $variables["domainTemplate"] = array("TITLE", "DESCRIPTION", "NAVIGATION", "HEADER", "PAGE"); $variables["contentTemplate"] = array("TEXT", "IMAGE", "DOWNLOADS", "CONTENTID", "HANDLER"); $variables["naviTemplate"] = array("LINK", "URL", "TEXT"); $variables["pageTemplate"] = array("HEADER", "CONTENT", "DOMAIN"); $variables["dlTemplate"] = array("TEXT", "DOWNLOADS"); #$this->setParser("html","Util::base64Parser"); if ($this->A == null and $id != -1) { $this->loadMe(); } if ($id == -1) { $this->A = $this->newAttributes(); } $gui = new HTMLGUI(); $gui->setObject($this); $gui->setName("Template"); $TG = new TemplatesGUI(); $options = $TG->getAvailableCategories(); $gui->setType("templateType", "select"); $gui->setOptions("templateType", array_keys($options), array_values($options)); $gui->setInputJSEvent("templateType", "onchange", "CMSTemplate.updateVariables(this);"); $gui->setInputJSEvent("templateType", "onkeyup", "CMSTemplate.updateVariables(this);"); $gui->setLabel("templateType", "Typ"); $gui->setType("html", "TextEditor64"); $gui->setType("TemplateDomainID", "radio"); $gui->setLabel("TemplateDomainID", "Domain"); $gui->setOptions("TemplateDomainID", array("0", $U), array("alle", "nur " . $Domain->getA()->title)); $gui->hideAttribute("TemplateID"); $gui->setType("aktiv", "hidden"); $gui->setStandardSaveButton($this, "Templates"); $vars = ""; foreach ($variables as $k => $v) { if (is_array($variables[$k])) { $vars .= "<p id=\"{$k}Variables\" style=\"" . ($this->A->templateType == $k ? "" : "display:none;") . "\">%%%" . implode("%%%<br />%%%", $variables[$k]) . "%%%</p>"; } } $html = "\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tnew Draggable('TBVarsContainer',{handle:'TBVarsHandler', zindex: 2000});\n\t\t\t\toldVarSelected = '" . ($this->A->templateType != null ? $this->A->templateType : "null") . "';\n\t\t\t</script>\n\t\t\t<div \n\t\t\t\tstyle=\"position:absolute;z-index:2000;left:450px;width:200px;border-width:1px;border-style:solid;" . (isset($variables[$this->A->templateType]) ? "" : "display:none;") . "\"\n\t\t\t\tclass=\"backgroundColor0 borderColor1\"\n\t\t\t\tid=\"TBVarsContainer\"\n\t\t\t>\n\t\t\t<div class=\"cMHeader backgroundColor1\" id=\"TBVarsHandler\">Variablen:</div>\n\t\t\t<div>\n\t\t\t\t<p><small>Sie können folgende Variablen in Ihrem HTML verwenden (bitte beachen Sie Groß- und Kleinschreibung):</small></p>\n\t\t\t\t{$vars}\n\t\t\t</div>\n\t\t\t</div>"; return $html . $gui->getEditHTML(); }
function getHTML($id) { $type = "none"; $U = new mUserdata(); $U = $U->getUDValue("selectedDomain"); $bps = $this->getMyBPSData(); if ($bps != -1 and isset($bps["type"])) { $type = $bps["type"]; } $this->loadMeOrEmpty(); if ($id == -1) { if ($type != "none" and $type != "undefined") { $this->A->SeiteID = $type; } } $gui = new HTMLGUI(); $gui->setObject($this); $gui->setName("Content"); $gui->setType("contentType", "select"); $gui->setOptions("contentType", array("text", "preset", "downloads", "php"), array("Text", "HTML-Vorlage", "Downloads", "PHP")); $FB = new FileBrowser(); $FB->addDir("../specifics/"); if ($_SESSION["S"]->checkForPlugin("mShop")) { $FB->addDir("../multiCMS/Shop/"); } $a = $FB->getAsLabeledArray("iCustomContent", ".class.php"); $gui->setLabel("customContent", "Inhalt"); $gui->setType("customContent", "select"); $gui->setOptions("customContent", array_values($a), array_keys($a)); $Tab = new HTMLTable(1); if ($this->singular) { $gui->setType("sort", "hidden"); } else { $B = new Button("zurück", "back"); $B->onclick("contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . ");"); $Tab->addRow($B); } $gui->setLabel("contentType", "Typ"); $gui->setLabel("ContentImage", "Bild"); $gui->setLabel("SeiteID", "Seite"); $gui->setLabel("TemplateID", "Vorlage"); $gui->setLabel("sort", "Sortierung"); $gui->setFieldDescription("ContentImage", "Wird an Stelle des Parameters %%%IMAGE%%% eingesetzt."); #$gui->setType("header","hidden"); $gui->insertSpaceAbove("contentType"); #$gui->insertSpaceAbove("TemplateID","sonstiges", true); $gui->setInputJSEvent("contentType", "onchange", "Content.selectType(this);"); $gui->setType("text", "HTMLEditor"); if (Session::isPluginLoaded("mFile")) { $B = new Button("Bild auswählen", "./images/i2/add.png"); $B->type("icon"); $B->customSelect("contentRight", $this->ID, "mFile", "Content.selectImage"); $gui->activateFeature("addCustomButton", $this, "ContentImage", $B); } else { $gui->setType("ContentImage", "hidden"); } $gui->setShowAttributes(array("text", "ContentSpracheID", "ContentImage", "TemplateID", "header", "sort", "contentType", "presetTemplateID", "formHandlerID", "customContent")); $gui->setFormID("ContentForm"); $S = new anyC(); $S->setCollectionOf("Seite"); $gui->selectWithCollection("SeiteID", $S, "name"); $gui->setType("name", "hidden"); $gui->setType("SeiteID", "hidden"); $gui->setLabel("presetTemplateID", "Vorlage"); $gui->setLabel("formHandlerID", "Handler"); $gui->setLabel("ContentSpracheID", "Sprache"); if (Session::isPluginLoaded("mSprache")) { $Sprachen = new anyC(); $Sprachen->setCollectionOf("Sprache"); $gui->selectWithCollection("ContentSpracheID", $Sprachen, "SpracheIdentifier", "alle"); } else { $gui->setType("ContentSpracheID", "hidden"); } $aC = new anyC(); $aC->setCollectionOf("Template"); $aC->addAssocV3("templateType", "=", "presetTemplate"); $gui->selectWithCollection("presetTemplateID", $aC, "name"); if ($_SESSION["S"]->checkForPlugin("mHandler")) { $handlerAC = new anyC(); $handlerAC->setCollectionOf("Handler"); $handlerAC->addAssocV3("HandlerDomainID", "=", $U); $gui->selectWithCollection("formHandlerID", $handlerAC, "HandlerName", "keiner"); } else { $gui->setParser("formHandlerID", "ContentGUI::noHandlerParser"); } if ($this->A->contentType != "preset") { $gui->setLineStyle("presetTemplateID", "display:none;"); $gui->setLineStyle("formHandlerID", "display:none;"); } if ($this->A->contentType != "php") { $gui->setLineStyle("customContent", "display:none;"); } $T = new TemplatesGUI(); $T->addAssocV3("templateType", "=", "contentTemplate"); $T->addAssocV3("templateType", "=", "listTemplate", "OR"); $T->addAssocV3("templateType", "=", "tableTemplate", "OR"); $T->addAssocV3("templateType", "=", "dlTemplate", "OR"); $T->addOrderV3("templateType"); $TG = new TemplatesGUI(); $cats = $TG->getAvailableCategories(); $options = array(); while ($o = $T->getNextEntry()) { $options[$o->getID()] = $cats[$o->getA()->templateType]; } $T->resetPointer(); $gui->selectWithCollection("TemplateID", $T, "name"); $gui->selectOptgroup("TemplateID", $options); $gui->setJSEvent("onSave", "function() { contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . "); }"); $gui->setStandardSaveButton($this); $gui->customize($this->customizer); return $Tab . $gui->getEditHTML(); }