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();
 }
 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();
 }
Beispiel #3
0
 /**
  *  This Method activates several features. Possible values for HTMLGUI2 are:
  *
  *  multiEdit:
  *  creates multiEdit-Fields for the specified attributes when using getBrowserHTML()
  *
  *  par1: The attributes with multiEdit-fields
  *  par2: An array of HTMLInput-Elements to use
  *  par3: An array of style-attributes of the multiEdit-fields
  *
  *  ---
  *
  *  displayMode:
  *  creates multiEdit-Fields for the specified attributes when using getBrowserHTML()
  *
  *  par1: set true to display the new button
  *  par2: set true to display the edit button
  *  par3: set true to display the delete button
  *
  *  ---
  *
  * Some more features are available via the HTMLGUI-Class
  *
  * @param string $feature The feature to activate
  * @param PersistentObject Collection $class
  * @param $par1
  * @param $par2
  * @param $par3
  */
 function activateFeature($feature, $class, $par1 = null, $par2 = null, $par3 = null)
 {
     switch ($feature) {
         case "multiEdit":
             $this->multiEditMode = !is_array($par1) ? array($par1) : $par1;
             $this->multiEditModeInputs = !is_array($par2) ? array($par2) : $par2;
             $this->multiEditModeStyle = !is_array($par3) ? array($par3) : $par3;
             break;
         case "headerRow":
             $this->headerRow = !is_array($par1) ? array($par1) : $par1;
             break;
         case "displayMode":
             $this->showNewButton = $par1;
             $this->showEditButton = $par2;
             $this->showDeleteButton = $par3;
             break;
         case "reloadOnNew":
             if ($class instanceof PersistentObject and $class->getID() == -1) {
                 $this->setJSEvent("onSave", "function(transport){ contentManager.reloadOnNew(transport, '" . $class->getClearClass() . "'); }");
             }
             if ($class instanceof Collection) {
                 $this->setJSEvent("onNew", "contentManager.newClassButton('{$this->singularClass}', function(transport){ contentManager.reloadFrame('contentRight'); }, 'contentLeft', '" . $this->singularClass . "GUI;edit:ok');");
             }
             break;
         default:
             parent::activateFeature($feature, $class, $par1, $par2, $par3);
             break;
     }
 }
 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;
 }