public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletObjectId"]; $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $dialog = new \Widgets\Dialog(); //$dialog->setTitle("Eigenschaften von " . $object->get_name()); $dialog->setTitle("Bearbeiten von Nachrichten " . $object->get_attribute("OBJ_DESC")); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); //create widgets $list1 = new \Widgets\SelectList(); $button1 = new \Widgets\Button(); $button2 = new \Widgets\Button(); //get messages $inventory = $object->get_inventory(); foreach ($inventory as $message) { if ($message->get_attribute("DOC_TYPE") != "") { continue; } $list1->addOption($message->get_id(), $message->get_name()); } $button1->setLabel("neue Nachricht oben anfügen"); $button2->setLabel("neue Nachricht unten anfügen"); //add widgets to dialog $dialog->addWidget($list1); $dialog->addWidget($button1); $dialog->addWidget($button2); $this->dialog = $dialog; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); // $objectId = $params["messageObjectId"]; // $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); //var_dump($params); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Portfolio Importieren"); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $ajaxUploader = new \Widgets\AjaxUploader(); $imgWidget = new \Widgets\RawHtml(); $imgWidget->setHtml("Um ein Portfolio zu importieren ziehen sie die Datei auf dieses Feld oder doppelklicken sie hier.<br>"); //$ajaxUploader->setPreview($imgWidget); // } $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size'))); $ajaxUploader->setNamespace("Portfolio"); $ajaxUploader->setCommand("UploadImport"); $ajaxUploader->setDestId($params["id"]); $ajaxUploader->setMultiUpload(false); // $ajaxUploader->setOnComplete("function(id, fileName, responseJSON){document.getElementById('uploaderArtefact').src = '" . PATH_URL . "download/document/' + responseJSON.oid; jQuery('#uploaderArtefact').addClass('saved')}"); $ajaxUploader->setOnComplete("function(id, fileName, responseJSON){location.reload();}"); $dialog->addWidget($ajaxUploader); // $dialog->addWidget($raw); $dialog->addWidget(new \Widgets\Clearer()); $this->dialog = $dialog; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $idRequestObject = new \IdRequestObject(); /* $extensions = \ExtensionMaster::getInstance()->getExtensionByType("IObjectExtension"); $commands = array(); foreach ($extensions as $extension) { $command = $extension->getCreateNewCommand($idRequestObject); if ($command) { $commands[] = $command; } }*/ $dialog = new \Widgets\Dialog(); $dialog->setTitle("Create a new artefact."); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $html = "<div style=\"margin-left: 20px; margin-right: 20px\">"; $noteImageUrl = $this->getExtension()->getAssetUrl() . "images/note.gif"; $fileImageUrl = $this->getExtension()->getAssetUrl() . "images/file.gif"; $html .= "<a href=\"\" onclick=\"sendRequest('NewUploadForm', {}, 'wizard_wrapper', 'wizard');return false;\" title=\"Create an artefact from a file.\"><img src=\"{$fileImageUrl}\"> Artefact from file (e.g. document, image, ...)</a><br>"; $html .= "<a href=\"\" onclick=\"sendRequest('NewTextForm', {}, 'wizard_wrapper', 'wizard');return false;\" title=\"Create a artefact with text.\"><img src=\"{$noteImageUrl}\"> Text </a><br>"; $html .= "</div><div id=\"wizard_wrapper\"></div>"; $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletId"]; $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")); $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([headline])")); $dialog->addWidget($titelInput); $dialog->addWidget(new \Widgets\Clearer()); $align = new \Widgets\ComboBox(); $align->setLabel("Ausrichtung"); $align->setOptions(array(array("name" => "Linksbündig", "value" => "left"), array("name" => "Rechtsbündig", "value" => "right"), array("name" => "Zentriert", "value" => "center"))); $align->setData($object); $align->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([alignment])")); $dialog->addWidget($align); $dialog->addWidget(new \Widgets\Clearer()); $size = new \Widgets\ComboBox(); $size->setLabel("Größe"); $size->setOptions(array(array("name" => "15", "value" => "15"), array("name" => "20", "value" => "20"), array("name" => "25", "value" => "25"), array("name" => "30", "value" => "30"), array("name" => "35", "value" => "35"), array("name" => "40", "value" => "40"), array("name" => "50", "value" => "50"), array("name" => "60", "value" => "60"))); $size->setData($object); $size->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([size])")); $dialog->addWidget($size); $this->dialog = $dialog; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $idRequestObject = new \IdRequestObject(); $idRequestObject->setId($this->id); $extensions = \ExtensionMaster::getInstance()->getExtensionByType("IObjectExtension"); $commands = array(); foreach ($extensions as $extension) { if (strstr(strtolower(get_class($extension)), "portlet")) { $command = $extension->getCreateNewCommand($idRequestObject); if ($command) { $commands[] = $command; } } } $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Erstelle ein neues Objekt in Spalte " . $object->get_name()); $dialog->setCloseButtonLabel(null); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $html = "<div id=\"wizard\" style=\"margin-left: 20px; margin-right: 20px\">"; foreach ($commands as $command) { $namespaces = $command->getExtension()->getUrlNamespaces(); $html .= "<a href=\"\" onclick=\"sendRequest('{$command->getCommandName()}', {'id':{$this->id}}, 'wizard', 'wizard', null, null, '{$namespaces[0]}');return false;\" title=\"{$command->getExtension()->getObjectReadableDescription()}\"><img src=\"{$command->getExtension()->getObjectIconUrl()}\"> {$command->getExtension()->getObjectReadableName()}</a><br>"; } $html .= "<div style=\"float:right\"><a class=\"button pill negative\" onclick=\"closeDialog();return false;\" href=\"#\">Abbrechen</a></div></div><div id=\"wizard_wrapper\"></div>"; $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
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; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletId"]; $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"]); $clearer = new \Widgets\Clearer(); /* not used $titelInput = new \Widgets\TextInput(); $titelInput->setLabel("Titel"); $titelInput->setData($object); $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC")); $dialog->addWidget($titelInput); $dialog->addWidget($clearer); */ $headlineInput = new \Widgets\TextInput(); $headlineInput->setLabel("Überschrift"); $headlineInput->setData($object); $headlineInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([headline])")); $dialog->addWidget($headlineInput); $dialog->addWidget($clearer); $urlInput = new \Widgets\TextInput(); $urlInput->setLabel("Adresse"); $urlInput->setData($object); $urlInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([url])")); $dialog->addWidget($urlInput); $dialog->addWidget($clearer); $descriptionInput = new \Widgets\TextInput(); $descriptionInput->setLabel("Beschreibung"); $descriptionInput->setData($object); $descriptionInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([description])")); $dialog->addWidget($descriptionInput); $dialog->addWidget($clearer); /* $mediaTypeInput = new \Widgets\TextInput(); $mediaTypeInput->setLabel("Typ"); //Film, Bild, Ton $mediaTypeInput->setData($object); $mediaTypeInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([media_type])")); $dialog->addWidget($mediaTypeInput); $dialog->addWidget($clearer); */ $radioButton = new \Widgets\RadioButton(); $radioButton->setLabel("Typ"); $radioButton->setOptions(array(array("name" => "Film", "value" => "movie"), array("name" => "Bild", "value" => "image"), array("name" => "Ton", "value" => "audio"))); $radioButton->setData($object); $radioButton->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([media_type])")); $dialog->addWidget($radioButton); $dialog->addWidget($clearer); $this->dialog = $dialog; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["messageObjectId"]; $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $oldImageId = $object->get_attribute("bid:portlet:msg:picture_id"); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Meldungsbild bearbeiten"); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); //$dialog->setWidth(450); $emptyImageUrl = PATH_URL . "portletMsg/asset/empty.jpg"; $ajaxUploader = new \Widgets\AjaxUploader(); if ($oldImageId !== 0) { $imgWidget = new \Widgets\RawHtml(); $imgWidget->setHtml("Um ein Bild hochzuladen ziehen sie eine Datei auf dieses Feld oder doppelklicken sie hier.<br><img id=\"uploaderImage\" src=\"" . PATH_URL . "download/document/{$oldImageId}\"></img>"); $ajaxUploader->setPreview($imgWidget); } else { $imgWidget = new \Widgets\RawHtml(); $imgWidget->setHtml("Um ein Bild hochzuladen ziehen sie eine Datei auf dieses Feld oder doppelklicken sie hier.<br><img id=\"uploaderImage\" src=\"{$emptyImageUrl}\"></img>"); $ajaxUploader->setPreview($imgWidget); } $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size'))); $ajaxUploader->setNamespace("PortletMsg"); $ajaxUploader->setCommand("UploadImage"); $ajaxUploader->setDestId($object->get_id()); $ajaxUploader->setMultiUpload(false); $ajaxUploader->setOnComplete("function(id, fileName, responseJSON){document.getElementById('uploaderImage').src = '" . PATH_URL . "download/document/' + responseJSON.oid; jQuery('#uploaderImage').addClass('saved')}"); $dialog->addWidget($ajaxUploader); $raw = new \Widgets\RawHtml(); $raw->setHtml(<<<END \t\t<a href="#" class="button pill negative" onclick="sendRequest('DeleteImage', {'id':{$object->get_id()}}, '', 'data', null, function() {document.getElementById('uploaderImage').src = '{$emptyImageUrl}'; jQuery('#uploaderImage').addClass('saved')}, 'PortletMsg');">Bild löschen</a> END ); $dialog->addWidget($raw); $dialog->addWidget(new \Widgets\Clearer()); $radioButton = new \Widgets\RadioButton(); $radioButton->setLabel("Bildposition"); $radioButton->setOptions(array(array("name" => "links", "value" => "left"), array("name" => "nicht umfließend", "value" => "none"), array("name" => "rechts", "value" => "right"))); $radioButton->setData($object); $radioButton->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:picture_alignment")); $dialog->addWidget($radioButton); $dialog->addWidget(new \Widgets\Clearer()); $sizeInput = new \Widgets\TextInput(); $sizeInput->setLabel("Bildbreite"); $sizeInput->setData($object); $sizeInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:msg:picture_width")); $dialog->addWidget($sizeInput); $this->dialog = $dialog; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletId"]; $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Eigenschaften von Spalte " . $object->get_attribute("OBJ_DESC")); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $clearer = new \Widgets\Clearer(); $sizeInput = new \Widgets\TextInput(); $sizeInput->setLabel("Breite der Spalte"); $sizeInput->setData($object); $sizeInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portal:column:width")); $dialog->addWidget($sizeInput); $dialog->addWidget($clearer); $this->dialog = $dialog; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletId"]; $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"]); $titel = new \Widgets\TextInput(); $clearer = new \Widgets\Clearer(); $titel->setLabel("Überschrift"); $titel->setData($object); $titel->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC")); $dialog->addWidget($titel); $dialog->addWidget($clearer); $this->dialog = $dialog; }
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; }
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; }
public function processData(\IRequestObject $requestObject) { $params = $requestObject->getParams(); $objectId = $params["portletId"]; $categoryIndex = $params["categoryIndex"]; $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId); $dialog = new \Widgets\Dialog(); //$dialog->setTitle("Eigenschaften von Kategorie: $categoryIndex in " . $object->get_name()); $dialog->setTitle("Bearbeiten von Kategorie"); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $clearer = new \Widgets\Clearer(); $titel = new \Widgets\TextInput(); $titel->setLabel("Titel"); $titel->setData($object); //$titel->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC")); $titel->setContentProvider(new AttributeDataProviderPortletTopicCategory($categoryIndex)); $dialog->addWidget($titel); $dialog->addWidget($clearer); $this->dialog = $dialog; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $currentUserName = $currentUser->get_name(); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Eintrag diskutieren"); $dialog->setDescription("..."); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); // get discussion thread between portfolio owner and current user or create empty thread $threads = $this->entry->get_annotations(); $discussion = null; foreach ($threads as $thread) { if ($thread->get_name() === $currentUserName) { $discussion = $thread; } } if (!isset($discussion)) { $discussion = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), $currentUserName, "Discussing with " . $currentUserName . ".", "text/plain"); $this->entry->add_annotation($discussion); } $chat = new \Widgets\Chat(); $chat->setData($discussion); $dialog->addWidget($chat); $dialog->addWidget(new \Widgets\Clearer()); $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml("<hr>"); $dialog->addWidget($rawHtml); $textinput = new \Widgets\TextInput(); $textinput->setData($discussion); $textinput->setContentProvider(\Widgets\DataProvider::annotationDataProvider()); $textinput->setLabel("Kommentar schreiben"); $dialog->addWidget($textinput); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $commands = array(); $commands[] = new \Explorer\Commands\NewDocumentForm(); $commands[] = new \Explorer\Commands\NewFolderForm(); $commands[] = new \Portfolio\Commands\NewArtefactForm(); $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Erstelle ein neues Artefakt"); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $html = "<div id=\"wizard\" style=\"margin-left: 20px; margin-right: 20px\">"; foreach ($commands as $command) { $namespaces = $command->getExtension()->getUrlNamespaces(); $html .= "<a href=\"\" onclick=\"sendRequest('{$command->getCommandName()}', {'id':{$this->id}}, 'wizard', 'wizard', null, null, '{$namespaces[0]}');return false;\" title=\"{$command->getExtension()->getObjectReadableDescription()}\"><img src=\"{$command->getExtension()->getObjectIconUrl()}\"> {$command->getExtension()->getObjectReadableName()}</a><br>"; } $html .= "</div><div id=\"wizard_wrapper\"></div>"; $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $objId = $this->id; $steam = $GLOBALS["STEAM"]; $steamUser = \lms_steam::get_current_user(); $dialog = new \Widgets\Dialog(); $dialog->setWidth(600); $dialog->setTitle("Rechte von »" . getCleanName($object) . "«"); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); //GET CREATOR TODO: USEFULL FOR ROOT FOLDER $env = $object->get_environment(); $envName = $env instanceof \steam_room ? $env->get_name() : ""; //SET ICON URL $privatePicUrl = PATH_URL . "explorer/asset/icons/private.png"; $userdefPicUrl = PATH_URL . "explorer/asset/icons/user_defined.png"; $userglobalPicUrl = PATH_URL . "explorer/asset/icons/server_public.png"; $worldglobalPicUrl = PATH_URL . "explorer/asset/icons/world_public.png"; //GET OWNER OF THE CURRENT OBJECT $owner = $object->get_creator(); $creatorId = $owner->get_id(); $ownerFullName = $owner->get_full_name(); //GET ACQUIRE SETTINGS $acquire = $object->get_acquire(); $acqChecked = $acquire instanceof \steam_room ? true : false; //GET FAVORITES $favs = $steamUser->get_buddies(); $favorites = array(); foreach ($favs as $fav) { $favorites[$fav->get_id()] = $fav; } //GET GROUPS $groups = $steamUser->get_groups(); //GET GROUPS EVERYONE $everyone = \steam_factory::groupname_to_object($steam->get_id(), "everyone"); $everyoneId = $everyone->get_id(); $groups[$everyoneId] = $everyone; //GET GROUP STEAM $steamgroup = \steam_factory::groupname_to_object($steam->get_id(), "sTeam"); $steamgroupId = $steamgroup->get_id(); //GET SOME ATTRIBUTES $attrib = $object->get_attributes(array(OBJ_NAME, OBJ_DESC, "bid:doctype")); //GET SANCTION $sanction = $object->get_sanction(); if ($env instanceof \steam_room) { $environmentSanction = $env->get_sanction(); } $additionalUser = array(); foreach ($sanction as $id => $sanct) { if (!array_key_exists($id, $groups) && !array_key_exists($id, $favorites) && $id != $creatorId && $id != 0 && $id != $everyoneId) { $additionalUser[$id] = \steam_factory::get_object($steam->get_id(), $id); } } $bid_doctype = isset($attrib["bid:doctype"]) ? $attrib["bid:doctype"] : ""; $docTypeQuestionary = strcmp($attrib["bid:doctype"], "questionary") == 0; $docTypeMessageBoard = $object instanceof \steam_messageboard; if ($docTypeQuestionary) { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_INSERT; } else { if ($docTypeMessageBoard) { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_ANNOTATE; } else { $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_WRITE | SANCTION_EXECUTE | SANCTION_MOVE | SANCTION_INSERT | SANCTION_ANNOTATE; } } //MAPPING GROUPS $groupsMapping = array(); $groupsMapping[$everyone->get_id()] = $everyone->get_name(); foreach ($groups as $group) { $groupsMapping[$group->get_id()] = $group->get_name(); } //MAPPING FAVORITES $favoritesMapping = array(); foreach ($favorites as $favorite) { if ($favorite instanceof \steam_user) { $favoritesMapping[$favorite->get_id()] = $favorite->get_full_name(); } else { $favoritesMapping[$favorite->get_id()] = $favorite->get_name(); } } //MAPPING ADDITIONAL USERS $additionalMapping = array(); foreach ($sanction as $id => $sanct) { if (!array_key_exists($id, $groupsMapping) && !array_key_exists($id, $favoritesMapping) && $id != $creatorId && $id != 0 && $id != $everyoneId) { $additionalMapping[$id] = \steam_factory::get_object($steam->get_id(), $id)->get_name(); } } //MAPPING ADDITIONAL USERS ACQUIRED $additionalMappingEnvironment = array(); if (isset($environmentSanction) && count($environmentSanction) > 0) { foreach ($environmentSanction as $id => $sanct) { if (!array_key_exists($id, $groupsMapping) && !array_key_exists($id, $favoritesMapping) && $id != $creatorId && $id != 0 && $id != $groupEveryoneId) { $additionalMappingEnvironment[$id] = \steam_factory::get_object($steam, $id)->get_name(); } } } $content = \Explorer::getInstance()->loadTemplate("sanction.template.html"); //ACQUIRE if ($envName == "") { $content->setVariable("NO_ENVIRONMENT", "disabled"); } if ($acqChecked) { $content->setVariable("ACQUIRE_START", "activateAcq();"); } $content->setVariable("INHERIT_FROM", getCleanName($env)); //PICTURES $content->setVariable("PRIVATE_PIC", $privatePicUrl); $content->setVariable("USER_DEF_PIC", $userdefPicUrl); $content->setVariable("USER_GLOBAL_PIC", $userglobalPicUrl); $content->setVariable("SERVER_GLOBAL_PIC", $worldglobalPicUrl); //OWNER $content->setVariable("OWNER_FULL_NAME", $ownerFullName); $content->setVariable("EVERYONE_ID", $everyoneId); $content->setVariable("STEAM_ID", $steamgroupId); $content->setVariable("SEND_REQUEST_SANCTION", 'sendRequest("UpdateSanctions", { "id": ' . $objId . ', "sanctionId": id, "type": "sanction", "value": value }, "", "data", function(response){jQuery(\'#dynamic_wrapper\').remove(); jQuery(\'#overlay\').remove(); sendRequest(\'Sanctions\', {\'id\':\'' . $objId . '\'}, \'\', \'popup\', null, null, \'explorer\');}, null, "explorer");'); $content->setVariable("SEND_REQUEST_CRUDE", 'sendRequest("UpdateSanctions", { "id": ' . $objId . ', "type": "crude", "value": value }, "", "data", function(response){jQuery(\'#dynamic_wrapper\').remove(); jQuery(\'#overlay\').remove(); sendRequest(\'Sanctions\', {\'id\':\'' . $objId . '\'}, \'\', \'popup\', null, null, \'explorer\');}, null, "explorer");'); $content->setVariable("SEND_REQUEST_ACQ_ACT", 'sendRequest("UpdateSanctions", { "id": ' . $objId . ', "type": "acquire", "value": "acq" }, "", "data", null, null, "explorer");'); $content->setVariable("SEND_REQUEST_ACQ_DEACT", 'sendRequest("UpdateSanctions", { "id": ' . $objId . ', "type": "acquire", "value": "non_acq" }, "", "data", null, null, "explorer");'); //TEMPLATE GROUPS if (count($groupsMapping) == 0) { $content->setVariable("NO_GROUP_MEMBER", "Sie sind kein Mitglied einer Gruppe"); $content->setVariable("NO_GROUP_MEMBER_ACQ", "Sie sind kein Mitglied einer Gruppe"); } else { foreach ($groupsMapping as $id => $name) { $dropDownValue = 0; if (isset($sanction[$id])) { if ($sanction[$id] == SANCTION_READ) { $dropDownValue = 1; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValue = 2; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValue = 3; } } $dropDownValueAcq = 0; if (isset($environmentSanction[$id])) { if ($environmentSanction[$id] == SANCTION_READ) { $dropDownValueAcq = 1; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValueAcq = 2; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValueAcq = 3; } } //HACK $group = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id); // SANCTION_WRITE | SANCTION_EXECUTE | SANCTION_MOVE | SANCTION_INSERT | SANCTION_ANNOTATE; $readCheck = $object->check_access_read($group); $writeCheck = $object->check_access($SANCTION_WRITE_FOR_CURRENT_OBJECT, $group); $sanctionCheck = $object->check_access(SANCTION_SANCTION, $group); $content->setCurrentBlock("GROUPS"); $content->setCurrentBlock("GROUP_DDSETTINGS"); $content->setVariable("GROUPID", $id); $content->setVariable("GROUP_ID", $id); if ($sanctionCheck) { $content->setVariable("GROUP_RIGHTS", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("GROUP_RIGHTS", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("GROUP_RIGHTS", "Nur Lesen"); } else { $content->setVariable("GROUP_RIGHTS", ""); } if ($name == "Everyone") { $content->setVariable("GROUPNAME", "Jeder"); } else { if ($name == "sTeam") { $content->setVariable("GROUPNAME", "Angemeldete Benutzer"); } else { $content->setVariable("GROUPNAME", $group->get_groupname()); } } $content->setVariable("OPTIONVALUE", $dropDownValue); $content->parse("GROUP_DDSETTINGS"); $content->parse("GROUPS"); $content->setCurrentBlock("GROUPS_ACQ"); $content->setCurrentBlock("GROUP_DDSETTINGS_ACQ"); $content->setVariable("GROUPID_ACQ", $id); $content->setVariable("GROUP_ID_ACQ", $id); if ($name == "Everyone") { $content->setVariable("GROUPNAME_ACQ", "Jeder"); } else { if ($name == "sTeam") { $content->setVariable("GROUPNAME_ACQ", "Angemeldete Benutzer"); } else { $content->setVariable("GROUPNAME_ACQ", $name); } } if ($sanctionCheck) { $content->setVariable("GROUP_RIGHTS_ACQ", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("GROUP_RIGHTS_ACQ", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("GROUP_RIGHTS_ACQ", "Nur Lesen"); } else { $content->setVariable("GROUP_RIGHTS_ACQ", ""); } $content->setVariable("OPTIONVALUE_ACQ", $dropDownValueAcq); $content->parse("GROUP_DDSETTINGS_ACQ"); $content->parse("GROUPS_ACQ"); } } //TEMPLATE FAVORITES if (count($favoritesMapping) == 0) { $content->setVariable("NO_FAV_MEMBER", "Sie haben keine Favoriten"); $content->setVariable("NO_FAV_MEMBER_ACQ", "Sie haben keine Favoriten"); } else { $content->setVariable("DUMMY_FAV", ""); $content->setVariable("DUMMY_FAV_ACQ", ""); foreach ($favoritesMapping as $id => $name) { $dropDownValue = 0; if (isset($sanction[$id])) { if ($sanction[$id] == SANCTION_READ) { $dropDownValue = 1; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValue = 2; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValue = 3; } } $dropDownValueAcq = 0; if (isset($environmentSanction[$id])) { if ($environmentSanction[$id] == SANCTION_READ) { $dropDownValueAcq = 1; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValueAcq = 2; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValueAcq = 3; } } $favo = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id); $readCheck = $object->check_access_read($favo); $writeCheck = $object->check_access($SANCTION_WRITE_FOR_CURRENT_OBJECT, $favo); $sanctionCheck = $object->check_access(SANCTION_SANCTION, $favo); $content->setCurrentBlock("FAVORITES"); $content->setCurrentBlock("FAV_DDSETINGS"); $content->setVariable("FAVID", $id); $content->setVariable("FAV_ID", $id); $content->setVariable("FAVNAME", $name); $content->setVariable("FAV_OPTION_VALUE", $dropDownValue); if ($sanctionCheck) { $content->setVariable("FAV_RIGHTS", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("FAV_RIGHTS", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("FAV_RIGHTS", "Nur Lesen"); } else { $content->setVariable("FAV_RIGHTS", ""); } $content->parse("FAV_DDSETTINGS"); $content->parse("FAVORITES"); $content->setCurrentBlock("FAVORITES_ACQ"); $content->setCurrentBlock("FAV_DDSETINGS_ACQ"); $content->setVariable("FAVID_ACQ", $id); $content->setVariable("FAV_ID_ACQ", $id); if ($sanctionCheck) { $content->setVariable("FAV_RIGHTS_ACQ", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("FAV_RIGHTS_ACQ", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("FAV_RIGHTS_ACQ", "Nur Lesen"); } else { $content->setVariable("FAV_RIGHTS_ACQ", ""); } $content->setVariable("FAVNAME_ACQ", $name); $content->setVariable("FAV_OPTION_VALUE_ACQ", $dropDownValueAcq); $content->parse("FAV_DDSETTING_ACQS"); $content->parse("FAVORITES_ACQ"); } } //TEMPLATE ADDITIONAL USERS if (count($additionalMapping) == 0) { $content->setVariable("NO_AU_MEMBER", "Keine weiteren berechtigten Nutzer"); } else { $content->setVariable("DUMMY_AU", ""); $content->setVariable("DUMMY_AU_ACQ", ""); foreach ($additionalMapping as $id => $name) { $au = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id); // SANCTION_WRITE | SANCTION_EXECUTE | SANCTION_MOVE | SANCTION_INSERT | SANCTION_ANNOTATE; $readCheck = $object->check_access_read($au); $writeCheck = $object->check_access($SANCTION_WRITE_FOR_CURRENT_OBJECT, $au); $sanctionCheck = $object->check_access(SANCTION_SANCTION, $au); $dropDownValue = 0; if (isset($sanction[$id])) { if ($sanction[$id] == SANCTION_READ) { $dropDownValue = 1; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValue = 2; } elseif ($sanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValue = 3; } } $content->setCurrentBlock("AU"); $content->setCurrentBlock("AU_DDSETINGS"); $content->setVariable("AUID", $id); $content->setVariable("AU_ID", $id); $content->setVariable("AUNAME", $name); $content->setVariable("AU_OPTION_VALUE", $dropDownValue); if ($sanctionCheck) { $content->setVariable("AU_RIGHTS", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("AU_RIGHTS", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("AU_RIGHTS", "Nur Lesen"); } else { $content->setVariable("AU_RIGHTS", ""); } $content->parse("AU_DDSETTINGS"); $content->parse("AU"); } } if (count($additionalMappingEnvironment) == 0) { $content->setVariable("NO_AU_MEMBER_ACQ", "Keine weiteren berechtigten Nutzer"); } else { foreach ($additionalMappingEnvironment as $id => $name) { $readCheck = $object->check_access_read($au); $writeCheck = $object->check_access($SANCTION_WRITE_FOR_CURRENT_OBJECT, $au); $sanctionCheck = $object->check_access(SANCTION_SANCTION, $au); $dropDownValueAcq = 0; if (isset($environmentSanction[$id])) { if ($environmentSanction[$id] == SANCTION_READ) { $dropDownValueAcq = 1; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT)) { $dropDownValueAcq = 2; } elseif ($environmentSanction[$id] <= (SANCTION_READ | $SANCTION_WRITE_FOR_CURRENT_OBJECT | SANCTION_SANCTION)) { $dropDownValueAcq = 3; } } $content->setCurrentBlock("AU_ACQ"); $content->setCurrentBlock("AU_DDSETINGS_ACQ"); $content->setVariable("AUID_ACQ", $id); $content->setVariable("AU_ID_ACQ", $id); if ($sanctionCheck) { $content->setVariable("AU_RIGHTS_ACQ", "Lesen, Schreiben und Berechtigen"); } elseif ($writeCheck) { $content->setVariable("AU_RIGHTS_ACQ", "Lesen und Schreiben"); } elseif ($readCheck) { $content->setVariable("AU_RIGHTS_ACQ", "Nur Lesen"); } else { $content->setVariable("AU_RIGHTS_ACQ", ""); } $content->setVariable("AUNAME_ACQ", $name); $content->setVariable("AU_OPTION_VALUE_ACQ", $dropDownValueAcq); $content->parse("AU_DDSETTINGS_ACQ"); $content->parse("AU_ACQ"); } } $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($content->get()); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $entry = $this->entry; $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $dialog = new \Widgets\Dialog(); $dialog->setTitle($entry::getEntryTypeEditDescription()); $dialog->setDescription($entry::getEntryTypeEditInfo()); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $dialog->setForceReload(true); $dialog->setButtons(array(array("class" => "negative", "js" => "sendRequest('deleteEntry', {'id':'{$this->id}'}, '', 'data', null, function(response) {closeDialog(); location.reload();}); return false;", "label" => "Löschen"))); $clearer = new \Widgets\Clearer(); $entryAttributes = $entry->getEntryAttributes(); foreach ($entryAttributes as $entryAttribute) { $widget = new $entryAttribute["widget"](); $widget->setData($this->id); $widget->setContentProvider(new \Widgets\AttributeDataProvider($entryAttribute["attributeName"])); $widget->setLabel($entryAttribute["label"]); $dialog->addWidget($widget); $dialog->addWidget($clearer); } /* $type = new \Widgets\ComboBox(); $type->setData($this->id); $type->setContentProvider(new \Widgets\AttributeDataProvider("PORTFOLIO_ENTRY_SCHOOL_TYPE")); $type->setLabel("Schulabschluss"); $type->setOptions(array(array("name"=>"Volks/- Hauptschulabschluss", "value"=>"haupt"), array("name"=>"Mittlere Reife/Realschulabschluss", "value"=>"real"), array("name"=>"Fachhochschulreife", "value"=>"fh"), array("name"=>"Abitur", "value"=>"abi"), array("name"=>"Sonstige", "value"=>"sonst"))); $dialog->addWidget($type); $dialog->addWidget($clearer); $note = new \Widgets\ComboBox(); $note->setData($this->id); $note->setContentProvider(new \Widgets\AttributeDataProvider("PORTFOLIO_ENTRY_SCHOOL_NOTE")); $note->setLabel("Druchschnittsnote"); $note->setOptions(array(array("name"=>"Sehr gut (1)", "value"=>"1"), array("name"=>"Gut (2)", "value"=>"2"), array("name"=>"Befriedigend (3)", "value"=>"3"), array("name"=>"Ausreichend (4)", "value"=>"4"))); $dialog->addWidget($note); $dialog->addWidget($clearer); $year = new \Widgets\DatePicker(); $year->setData($this->id); $year->setContentProvider(new \Widgets\AttributeDataProvider("PORTFOLIO_ENTRY_DATE")); $year->setLabel("Abschlussdatum"); $year->setPlaceholder("z.B. 01.01.1995"); $dialog->addWidget($year); $dialog->addWidget($clearer); $bemerk = new \Widgets\TextInput(); $bemerk->setLabel("Bemerkung"); $bemerk->setData($this->id); $bemerk->setContentProvider(new \Widgets\AttributeDataProvider("PORTFOLIO_ENTRY_NOTE")); $bemerk->setPlaceholder("z.B. inhaltliche Schwerpunkte; besondere Leistungen"); $dialog->addWidget($bemerk); $dialog->addWidget($clearer);*/ $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
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; }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $ajaxForm = new \Widgets\AjaxForm(); $ajaxForm->setSubmitCommand("Create"); $ajaxForm->setSubmitNamespace("Gallery"); $ajaxForm->setHtml(<<<END <style type="text/css"> .attribute { clear: left; padding: 5px 2px 5px 2px; } .attributeName { float: left; padding-right: 20px; text-align: right; width: 80px; } .attributeValue { float: left; width: 300px; } .attributeValue .text, .attributeValue textarea { width: 300px; } .attributeValueColumn { float: left; position: relative; text-align: center; } </style> <input type="hidden" name="id" value="{$this->id}"> <div class="attribute"> \t<div class="attributeName">Galeriename:</div> \t<div class="attributeValue"><input type="text" class="text" value="" name="name"></div> </div> <br>\t\t\t END ); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($ajaxForm); //$idRequestObject = new \IdRequestObject(); //$idRequestObject->setId($this->id); return $ajaxResponseObject; $extensions = \ExtensionMaster::getInstance()->getExtensionByType("IObjectExtension"); $commands = array(); foreach ($extensions as $extension) { $command = $extension->getCreateNewCommand($idRequestObject); if ($command) { $commands[] = $command; } } //hole objekt $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Erstelle ein neues Objekt in " . $object->get_name()); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $html = ""; foreach ($commands as $command) { $html .= $command->getExtensionName() . "<br>"; } $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }