Пример #1
0
 public function processData(\IRequestObject $requestObject)
 {
     $params = $requestObject->getParams();
     $objectId = $params["messageObjectId"];
     $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Meldung bearbeiten");
     $dialog->setPositionX($this->params["mouseX"]);
     $dialog->setPositionY($this->params["mouseY"]);
     //$dialog->setWidth(450);
     $clearer = new \Widgets\Clearer();
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_NAME"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Untertitel");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $contentText = new \Widgets\Textarea();
     $contentText->setLabel("Inhalt");
     $contentText->setTextareaClass("mce-small");
     $contentText->setWidth(480);
     $contentText->setData($object);
     $contentText->setContentProvider(\Widgets\DataProvider::contentProvider());
     $dialog->addWidget($contentText);
     $dialog->addWidget($clearer);
     $dialog->addWidget($clearer);
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Link-Text");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:link_url_label"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Link-Adresse");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:link_url"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $widget = new \Widgets\Checkbox();
     $widget->setLabel("Link in einem neuen Fenster öffnen");
     $widget->setData($object);
     $widget->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:link_open"));
     $widget->setCheckedValue("checked");
     $widget->setUncheckedValue("");
     $dialog->addWidget($widget);
     //create widgets
     //$button1 = new \Widgets\Button();
     //TODO: add a edit box for the message here
     //$button1->setLabel("abschicken");
     //add widgets to dialog
     //$dialog->addWidget($button1);
     $this->dialog = $dialog;
 }
Пример #2
0
 public function processData(\IRequestObject $requestObject)
 {
     $params = $requestObject->getParams();
     $objectId = $params["portletId"];
     $categoryIndex = $params["categoryIndex"];
     $entryIndex = $params["entryIndex"];
     $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $dialog = new \Widgets\Dialog();
     //$dialog->setTitle("Eigenschaften von Eintrag $entryIndex Kategorie $categoryIndex in " . $object->get_name());
     $dialog->setTitle("Bearbeiten von Eintrag");
     $dialog->setPositionX($this->params["mouseX"]);
     $dialog->setPositionY($this->params["mouseY"]);
     $clearer = new \Widgets\Clearer();
     $titel = new \Widgets\TextInput();
     $description = new \Widgets\TextInput();
     $link = new \Widgets\TextInput();
     $newBrowser = new \Widgets\Checkbox();
     //set labels
     $titel->setLabel("Titel");
     $description->setLabel("Beschreibung");
     $link->setLabel("Link-Adresse");
     $newBrowser->setLabel("Link in einem neuen Fenster öffnen");
     $titel->setData($object);
     $titel->setContentProvider(new AttributeDataProviderPortletTopicEntry($categoryIndex, $entryIndex, "title"));
     $description->setData($object);
     $description->setContentProvider(new AttributeDataProviderPortletTopicEntry($categoryIndex, $entryIndex, "description"));
     $link->setData($object);
     $link->setContentProvider(new AttributeDataProviderPortletTopicEntry($categoryIndex, $entryIndex, "link_url"));
     //checkbox
     $newBrowser->setData($object);
     $newBrowser->setCheckedValue("checked");
     $newBrowser->setUncheckedValue("");
     $newBrowser->setContentProvider(new AttributeDataProviderPortletTopicEntry($categoryIndex, $entryIndex, "link_target"));
     $dialog->addWidget($titel);
     $dialog->addWidget($clearer);
     $dialog->addWidget($description);
     $dialog->addWidget($clearer);
     $dialog->addWidget($link);
     $dialog->addWidget($clearer);
     $dialog->addWidget($newBrowser);
     $dialog->addWidget($clearer);
     $this->dialog = $dialog;
 }
Пример #3
0
 public function processData(\IRequestObject $requestObject)
 {
     $params = $requestObject->getParams();
     $objectId = $params["portletId"];
     $clearer = new \Widgets\Clearer();
     $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Bearbeiten von " . $object->get_attribute("OBJ_DESC"));
     $dialog->setPositionX($this->params["mouseX"]);
     $dialog->setPositionY($this->params["mouseY"]);
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
     $addressInput = new \Widgets\TextInput();
     $addressInput->setLabel("RSS-Adresse");
     $addressInput->setData($object);
     $addressInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([address])"));
     $countInput = new \Widgets\TextInput();
     $countInput->setLabel("Anzahl Beiträge");
     $countInput->setData($object);
     $countInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([num_items])"));
     $lengthInput = new \Widgets\TextInput();
     $lengthInput->setLabel("Länge des Inhalts");
     $lengthInput->setData($object);
     $lengthInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([desc_length])"));
     $checkbox = new \Widgets\Checkbox();
     $checkbox->setLabel("HTML zulassen");
     $checkbox->setData($object);
     $checkbox->setCheckedValue("checked");
     $checkbox->setUncheckedValue("");
     $checkbox->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([allow_html])"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $dialog->addWidget($addressInput);
     $dialog->addWidget($clearer);
     $dialog->addWidget($countInput);
     $dialog->addWidget($clearer);
     $dialog->addWidget($lengthInput);
     $dialog->addWidget($clearer);
     $dialog->addWidget($checkbox);
     $this->dialog = $dialog;
 }
Пример #4
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $type = "";
     $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
     $type = getObjectType($object);
     switch ($type) {
         case "document":
             $labelName = "Dateiname";
             $typeName = "Dokument";
             break;
         case "forum":
             $labelName = "Forumname";
             $typeName = "Forum";
             break;
         case "referenceFolder":
             $labelName = "Linkname";
             $typeName = "Referenz";
             break;
         case "referenceFile":
             $labelName = "Linkname";
             $typeName = "Referenz";
             break;
         case "user":
             $labelName = "Benutzername";
             $typeName = "Benutzer";
             break;
         case "group":
             $labelName = "Gruppenname";
             $typeName = "Gruppe";
             break;
         case "trashbin":
             $labelName = "Papierkorb";
             $typeName = "Papierkorb";
             break;
         case "gallery":
             $labelName = "Galeriename";
             $typeName = "Galerie";
             break;
         case "portal":
             $labelName = "Portalname";
             $typeName = "Portal";
             break;
         case "portalColumn":
             $labelName = "Spaltenname";
             $typeName = "Portal-Spalte";
             break;
         case "portalPortlet":
             $labelName = "Portletname";
             $typeName = "Portal-Portlet";
             break;
         case "userHome":
             $labelName = "Ordnername";
             $typeName = "Benutzerordner";
             break;
         case "groupWorkroom":
             $labelName = "Ordnername";
             $typeName = "Gruppen-Arbeitsraum";
             break;
         case "room":
             $labelName = "Ordnername";
             $typeName = "Ordner";
             break;
         case "container":
             $labelName = "Ordnername";
             $typeName = "Ordner";
             break;
         case "unknown":
             $labelName = "Name";
             $typeName = "unbekannt";
             break;
         default:
             $labelName = "Name";
             $typeName = "unbekannt";
             break;
     }
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Eigenschaften von »" . getCleanName($object) . "«<br>({$typeName})");
     $dialog->setPositionX($this->params["mouseX"]);
     $dialog->setPositionY($this->params["mouseY"]);
     if ($type == "userHome" || $type == "groupWorkroom") {
         $dataNameInput = new \Widgets\TextInput();
         $dataNameInput->setLabel("{$labelName}");
         $dataNameInput->setData($object);
         $dataNameInput->setReadOnly(true);
         $dataNameInput->setContentProvider(\Widgets\DataProvider::staticProvider(getCleanName($object, -1)));
         /*		$titelInput = new \Widgets\TextInput();
         			 $titelInput->setLabel("Titel (Beschreibung)");
         			 $titelInput->setData($object);
         			 $titelInput->setContentProvider(\Widgets\DataProvider::staticProvider(getCleanName($object)));*/
     } else {
         $dataNameInput = new \Widgets\TextInput();
         $dataNameInput->setLabel("{$labelName}");
         $dataNameInput->setData($object);
         $dataNameInput->setContentProvider(new NameAttributeDataProvider("OBJ_NAME", getCleanName($object, -1)));
         if ($type == "document") {
             $docType = $object->get_attribute("DOC_MIME_TYPE");
             $isJpg = strpos($docType, "jpg") !== false;
             $isJpeg = strpos($docType, "jpeg") !== false;
             $isGif = strpos($docType, "gif") !== false;
             $isPng = strpos($docType, "png") !== false;
             if ($isGif || $isJpeg || $isJpg || $isPng) {
                 $textArea = new \Widgets\Textarea();
                 $textArea->setLabel("Beschreibung");
                 $textArea->setData($object);
                 $textArea->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
                 $textArea->setHeight(100);
                 $desc = $object->get_attribute("OBJ_DESC");
                 if ($desc !== 0) {
                     $jsWrapperPicture = new \Widgets\JSWrapper();
                     $jsWrapperPicture->setJs('$(".plain").val("' . $desc . '")');
                 }
             }
         }
         /*		$titelInput = new \Widgets\TextInput();
         			 $titelInput->setLabel("Titel (Beschreibung)");
         			 $titelInput->setData($object);
         			 $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));*/
     }
     $ownerField = new \Widgets\TextField();
     $ownerField->setLabel("Besitzer");
     $creator = $object->get_creator();
     $creatorName = getCleanName($creator);
     $ownerField->setValue($creatorName);
     $changedField = new \Widgets\TextField();
     $changedField->setLabel("zuletzt geändert");
     $changedDate = $object->get_attribute(OBJ_LAST_CHANGED);
     $changedDate = getFormatedDate($changedDate);
     $changedField->setValue($changedDate);
     $createdField = new \Widgets\TextField();
     $createdField->setLabel("erstellt");
     $createDate = $object->get_attribute(OBJ_CREATION_TIME);
     $createDate = getFormatedDate($createDate);
     $createdField->setValue($createDate);
     //$hiddenCheckbox = new \Widgets\Checkbox();
     //$hiddenCheckbox->setLabel("Verstecken");
     //$hiddenCheckbox->setCheckedValue("1");
     //$hiddenCheckbox->setUncheckedValue(0);
     //$hiddenCheckbox->setData($object);
     //$hiddenCheckbox->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:hidden"));
     $containerViewRadio = new \Widgets\RadioButton();
     $containerViewRadio->setLabel("Erstes Dokument");
     $containerViewRadio->setData($object);
     $containerViewRadio->setOptions(array(array("name" => "Normal (Ordneransicht)", "value" => "normal"), array("name" => "Deckblatt (statt der Ordneransicht)", "value" => "index"), array("name" => "Kopfdokument (über der Ordneransicht)", "value" => "head")));
     $containerViewRadio->setDefaultChecked("normal");
     $containerViewRadio->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:presentation"));
     // 		$descriptionTextarea = new \Widgets\Textarea();
     // 		$descriptionTextarea->setLabel("Beschreibung");
     // 		$descriptionTextarea->setData($object);
     // 		$descriptionTextarea->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:description"));
     //TODO: value is array
     $keywordArea = new \Widgets\TextInput();
     $keywordArea->setLabel("Schlüsselwörter");
     $keywordArea->setData($object);
     $keywordArea->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_KEYWORDS"));
     //TODO: bid-attribute
     $descriptionInput = new \Widgets\TextInput();
     $descriptionInput->setLabel("Beschreibung");
     $descriptionInput->setData($object);
     $descriptionInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:description"));
     $checkboxInput = new \Widgets\Checkbox();
     $checkboxInput->setLabel("Benutzer dürfen editieren?");
     $checkboxInput->setCheckedValue("1");
     $checkboxInput->setUncheckedValue(0);
     $checkboxInput->setData($object);
     $checkboxInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:forum_is_editable"));
     $seperator = new \Widgets\RawHtml();
     $seperator->setHtml("<br style=\"clear:both\"/>");
     $headlineAlg = new \Widgets\RawHtml();
     $headlineAlg->setHtml("<h3>Allgemein</h3>");
     $headlineMeta = new \Widgets\RawHtml();
     $headlineMeta->setHtml("<h3>Meta-Informationen</h3>");
     $headlineView = new \Widgets\RawHtml();
     $headlineView->setHtml("<h3>Darstellung</h3>");
     $dialog->addWidget($headlineAlg);
     //$dialog->addWidget($titelInput);
     //$dialog->addWidget($seperator);
     if ($type == "document") {
         $docType = $object->get_attribute("DOC_MIME_TYPE");
         $isJpg = strpos($docType, "jpg") !== false;
         $isJpeg = strpos($docType, "jpeg") !== false;
         $isGif = strpos($docType, "gif") !== false;
         $isPng = strpos($docType, "png") !== false;
         if ($isGif || $isJpeg || $isJpg || $isPng) {
             $fileName = new \Widgets\TextInput();
             $fileName->setLabel("Dateiname");
             $fileName->setData($object);
             $fileName->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_NAME"));
             $dialog->addWidget($fileName);
         }
     } else {
         $dialog->addWidget($dataNameInput);
     }
     $dialog->addWidget($seperator);
     $dialog->addWidget($ownerField);
     $dialog->addWidget($seperator);
     $dialog->addWidget($changedField);
     $dialog->addWidget($seperator);
     $dialog->addWidget($createdField);
     $dialog->addWidget($seperator);
     if ($type == "container" || $type == "room") {
         $dialog->addWidget($headlineView);
         //$dialog->addWidget($hiddenCheckbox);
         //$dialog->addWidget($seperator);
         $dialog->addWidget($containerViewRadio);
         $dialog->addWidget($seperator);
     } else {
         if ($type == "document") {
             $docType = $object->get_attribute("DOC_MIME_TYPE");
             $isJpg = strpos($docType, "jpg") !== false;
             $isJpeg = strpos($docType, "jpeg") !== false;
             $isGif = strpos($docType, "gif") !== false;
             $isPng = strpos($docType, "png") !== false;
             if ($isGif || $isJpeg || $isJpg || $isPng) {
                 $dialog->addWidget($textArea);
                 $dialog->addWidget($jsWrapperPicture);
             }
         } else {
             if ($type == "forum") {
                 $creatorId = $creator->get_id();
                 $currentUser = $GLOBALS["STEAM"]->get_current_steam_user();
                 $currentUserId = $currentUser->get_id();
                 if ($currentUserId == $creatorId) {
                     //				$checkValue= $object->get_attribute("bid:forum_is_editable");
                     //				$checked = $checkValue ? 1 : 0;
                     //				$checkboxInput;
                     $dialog->addWidget($checkboxInput);
                     $dialog->addWidget($seperator);
                 }
             }
         }
     }
     // 		$dialog->addWidget($headlineMeta);
     // 		$dialog->addWidget($keywordArea);
     // 		$dialog->addWidget($seperator);
     // 		$dialog->addWidget($descriptionInput);
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($dialog);
     return $ajaxResponseObject;
 }