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();
 }
Esempio n. 2
0
 public function getHTML($id)
 {
     $this->loadMeOrEmpty();
     #if($this->A == null AND $id != -1) $this->loadMe();
     #if($id == -1) $this->A = new InstallationAttributes();
     BPS::setProperty("mInstallationGUI", "showErrorText", "1");
     $gui = new HTMLGUI();
     if (!Session::isPluginLoaded("multiInstall")) {
         $this->A->httpHost = "*";
         $gui->setType("httpHost", "hidden");
     } else {
         $gui->insertSpaceAbove("httpHost");
     }
     $gui->setObject($this);
     $gui->setName("Zugangsdaten");
     $gui->setType("password", "password");
     $gui->setLabel("datab", "Datenbank");
     $gui->setLabel("user", "Benutzer");
     $gui->setLabel("password", "Passwort");
     $gui->setLabel("httpHost", "Domain");
     $gui->setInputJSEvent("password", "onkeyup", "\$j('#maxLength').css('color', 'inherit'); if(\$j(this).val().length >  20) \$j('#maxLength').css('color', 'red');");
     $gui->setFieldDescription("password", "<span id=\"maxLength\">Die maximale Passwortlänge beträgt 20 Zeichen.</span>");
     $gui->setFieldDescription("host", "Der Rechner, auf dem die Datenbank liegt. Das kann 'localhost' sein, oder eine IP wie '192.168.8.243' oder ein Hostname wie 'rdbms.strato.de'.");
     $gui->setFieldDescription("httpHost", "unter der phynx erreichbar ist oder * für alle Domains");
     #$this->loadGUITranslation($gui);
     $gui->translate($this->loadTranslation());
     $gui->setJSEvent("onSave", "\n\t\t\t\tfunction() {\n\t\t\t\t\tcontentManager.emptyFrame('contentLeft');\n\t\t\t\t\tcontentManager.emptyFrame('contentBelow');\n\t\t\t\t\tcontentManager.reloadFrame('contentRight');" . "\n\t\t\t\t}");
     $gui->setStandardSaveButton($this);
     return $gui->getEditHTML();
 }
 function getHTML($id)
 {
     $U = new mUserdata();
     $U = $U->getUDValue("selectedDomain");
     $this->loadMeOrEmpty();
     if ($id == -1 and $U != null) {
         $this->A->DomainID = $U;
         $this->A->sort = -1;
         $this->A->SeiteID = -1;
     }
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Navigation");
     $N = new mNavigation();
     $N->addAssocV3("NavigationID", "!=", $this->ID);
     $N->addAssocV3("DomainID", "=", $U);
     //$gui->selectWithCollection("DomainID", new Domains(), "url");
     $gui->selectWithCollection("parentID", $N, "name", "kein übergeordnetes Element");
     #$gui->setType("parentID","hidden");
     #$gui->selectWithCollection("SeiteID", $aC, "name");
     /*$aC = new anyC();
     		$aC->setCollectionOf("Seite");
     		$aC->setFieldsV3(array("IF(name = '', header, name) AS name"));
     		$aC->addAssocV3("DomainID","=",$this->A->DomainID);
     		
     		$pages = array();
     		while($s = $aC->getNextEntry()){
     			$pages[$s->getID()] = $s->A("name");
     		}
     
     		$gui->setType("SeiteID","select");
     		$gui->setOptions("SeiteID", array_keys($pages), array_values($pages));*/
     $gui->setParser("SeiteID", "NavigationGUI::SeiteParser", array($this->A->DomainID));
     $gui->setType("DomainID", "hidden");
     $gui->insertSpaceAbove("activeTemplateID");
     $gui->insertSpaceAbove("linkType");
     $gui->insertSpaceAbove("hidden", "Optionen", true);
     $gui->setType("sort", "hidden");
     $gui->setLabel("httpsLink", "Https-Link?");
     $gui->setType("httpsLink", "checkbox");
     $gui->setLabel("activeTemplateID", "Link aktiv");
     $gui->setLabel("inactiveTemplateID", "Link inaktiv");
     $gui->setLabel("DomainID", "Domain");
     $gui->setLabel("SeiteID", "Seite");
     $gui->setLabel("parentID", "Vaterelement");
     /*if($this->A->linkType == "cmsPage" OR $id == -1)
     			$gui->setLineStyle("linkURL","display:none;");
     		else*/
     $gui->setLineStyle("SeiteID", "display:none;");
     $gui->setLineStyle("linkURL", "display:none;");
     $gui->setLineStyle("inactiveTemplateID", "display:none;");
     $gui->setLineStyle("activeTemplateID", "display:none;");
     if ($this->A->linkType == "cmsPage" or $id == -1) {
         $gui->setLineStyle("SeiteID", "");
         $gui->setLineStyle("inactiveTemplateID", "");
         $gui->setLineStyle("activeTemplateID", "");
     } else {
         if ($this->A->linkType == 'url') {
             $gui->setLineStyle("linkURL", "");
             $gui->setLineStyle("inactiveTemplateID", "");
         } else {
             if ($this->A->linkType == 'HTML') {
                 $gui->setLineStyle("activeTemplateID", "");
             } else {
                 if ($this->A->linkType == 'separator') {
                 }
             }
         }
     }
     if (Session::isPluginLoaded("mMultiLanguage")) {
         $gui->activateFeature("addAnotherLanguageButton", $this, "name");
     }
     $gui->setLabel("linkType", "Link-Typ");
     $gui->setInputJSEvent("linkType", "onchange", "Website.set(this)");
     $gui->setLabel("linkURL", "Link-URL");
     $T = new TemplatesGUI();
     $T->addAssocV3("templateType", "=", "naviTemplate");
     $gui->selectWithCollection("activeTemplateID", $T, "name");
     $T = new TemplatesGUI();
     $T->addAssocV3("templateType", "=", "naviTemplate");
     $gui->selectWithCollection("inactiveTemplateID", $T, "name");
     $gui->setLabel("hidden", "versteckt");
     $gui->setFieldDescription("hidden", "Der Menüpunkt wird auf der Seite nicht angezeigt");
     $gui->setType("hidden", "checkbox");
     #$gui->insertSpaceAbove("parentID");
     $gui->setLabel("displaySub", "Unterkat. immer anzeigen");
     $gui->setFieldDescription("displaySub", "Blendet die Unterkategorien immer ein, auch wenn der Menüpunkt nicht ausgewählt ist.");
     $gui->setType("displaySub", "checkbox");
     #$gui->setType("displaySub","hidden");
     $gui->setFieldDescription("httpsLink", "Erzeugt einen https://...-Link");
     $gui->setType("linkType", "select");
     #$gui->setOptions("linkType", array("cmsPage", "url", "separator"), array("multiCMS-Seite", "URL", "Trennlinie"));
     $gui->setOptions("linkType", array("cmsPage", "url", "separator", "HTML"), array("multiCMS-Seite", "URL", "Trennlinie", "Template-HTML"));
     if ($id == -1) {
         $gui->setJSEvent("onSave", "function() { \$('contentLeft').update(); contentManager.reloadFrameRight(); }");
     } else {
         $gui->setJSEvent("onSave", "function() { contentManager.reloadFrameRight(); }");
     }
     $gui->setStandardSaveButton($this);
     #$gui->setSaveButtonValues(get_parent_class($this),$this->ID,"mNavigation");
     return $gui->getEditHTML();
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 function getHTML($id)
 {
     $U = new mUserdata();
     $U = $U->getUDValue("selectedDomain");
     if ($id == -1) {
         $this->A = $this->newAttributes();
         $this->A->DomainID = $U;
         $this->A->header = "leere Seite";
         if ($_SESSION["S"]->checkForPlugin("Templates")) {
             $this->A->TemplateID = TemplatesGUI::getDefault("pageTemplate");
         }
         $id = $this->newMe();
         $c = new Content(-1);
         $cA = $c->newAttributes();
         $c->setA($cA);
         $c->changeA("SeiteID", $id);
         if ($_SESSION["S"]->checkForPlugin("Templates")) {
             $c->changeA("TemplateID", TemplatesGUI::getDefault("contentTemplate"));
         }
         $c->newMe();
         $this->forceReload();
     }
     if ($this->A == null) {
         $this->loadMe();
     }
     #$this->loadMeOrEmpty();
     #if($id == -1 AND $U != null) $this->A->DomainID = $U;
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Seite");
     $gui->setShowAttributes(array("header", "TemplateID", "name", "metaTagDescription", "permalink"));
     $gui->insertSpaceAbove("name", "sonstiges", true);
     $gui->setLabel("header", "Seitenname");
     #$gui->insertSpaceAbove("metaTagDescription");
     #$gui->setFieldDescription("header","wird auf der Seite angezeigt");
     $gui->setFieldDescription("name", "wird nur intern angezeigt");
     $gui->setFieldDescription("permalink", "Ein Name, unter der die Seite über ?permalink= erreichbar ist. Darf nur aus Buchstaben (keine Umlaute), Zahlen, _ und - bestehen und muss eindeutig für die Domain sein. Es kann dann mit mod_rewrite auf diesen permalink an Stelle der SeitenID verlinkt werden.");
     $gui->setLabel("TemplateID", "Vorlage");
     $gui->setType("DomainID", "hidden");
     $gui->setType("metaTagDescription", "textarea");
     $gui->setLabel("metaTagDescription", "Beschreibung für meta tag");
     $gui->setInputJSEvent("metaTagDescription", "onkeyup", "\$('charCounter').update(\$('metaTagDescription').value.length)");
     $gui->setFieldDescription("metaTagDescription", "<span id=\"charCounter\">" . strlen($this->A("metaTagDescription")) . "</span> Zeichen");
     $gui->setInputStyle("metaTagDescription", "font-size:8px;");
     if (Session::isPluginLoaded("mMultiLanguage")) {
         $gui->activateFeature("addAnotherLanguageButton", $this, "header");
     }
     if (Session::isPluginLoaded("Templates")) {
         $T = new anyC();
         $T->setCollectionOf("Template");
         $T->addAssocV3("templateType", "=", "pageTemplate", "AND", "1");
         $T->addAssocV3("TemplateDomainID", "=", "0", "AND", "2");
         $T->addAssocV3("TemplateDomainID", "=", $this->A("DomainID"), "OR", "2");
         $gui->selectWithCollection("TemplateID", $T, "name");
     } else {
         $gui->setType("TemplateID", "hidden");
     }
     $gui->setStandardSaveButton($this);
     $H = "";
     $E = "";
     $C = new mContentGUI();
     $C->addAssocV3("SeiteID", "=", $this->ID);
     $C->lCV3();
     if ($C->numLoaded() == 1) {
         $content = $C->getNextEntry();
         $H = new ContentGUI($content->getID());
         $H->singular = true;
         $H = "<div style=\"height:20px;width:20px;\"></div>" . $H->getHTML($content->getID());
     } else {
         $E = $C->getHTML(-1);
     }
     $tab = new HTMLTable(1);
     $tab->setTableStyle("margin-top:20px;");
     $B = new Button("Content\nhinzufügen", "gutschrift");
     $B->rmePCR("Seite", $this->ID, "createContent", "", "contentManager.reloadFrame('contentLeft');");
     $tab->addRow($B);
     return $gui->getEditHTML() . $H . $tab . $E;
 }