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;
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $pyramidPosition = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
     $user = $GLOBALS["STEAM"]->get_current_steam_user();
     if ($this->params["action"] == "join") {
         // changing group (only) in the group choosing phase
         $pyramid = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["pyramid"]);
         $phase = $pyramid->get_attribute("PYRAMIDDISCUSSION ACTCOL");
         if ($phase == 0) {
             if ($this->params["formergroup"] == $this->params["newgroup"]) {
                 $formergroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["formergroup"]);
                 $formergroup->remove_member($user);
             } else {
                 if ($this->params["formergroup"] == 0) {
                     $newgroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["newgroup"]);
                     $newgroup->add_member($user);
                 } else {
                     $formergroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["formergroup"]);
                     $formergroup->remove_member($user);
                     $newgroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["newgroup"]);
                     $newgroup->add_member($user);
                 }
             }
         }
         $ajaxResponseObject->setStatus("ok");
         return $ajaxResponseObject;
     } else {
         $read_position_states = array();
         $read_position_states[$user->get_id()] = 1;
         $pyramidPosition->set_attribute("PYRAMIDDISCUSSION_POS_READ_STATES", $read_position_states);
         $column = $pyramidPosition->get_attribute("PYRAMIDDISCUSSION_COLUMN");
         $row = $pyramidPosition->get_attribute("PYRAMIDDISCUSSION_ROW");
         $dialog = new \Widgets\Dialog();
         $dialog->setTitle("Bearbeite Position " . $column . "-" . $row);
         $dialog->setWidth("600");
         $clearer = new \Widgets\Clearer();
         $titleInput = new \Widgets\TextInput();
         $titleInput->setLabel("Titel");
         $titleInput->setData($pyramidPosition);
         $titleInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
         $dialog->addWidget($titleInput);
         $dialog->addWidget($clearer);
         $textareaWidget = new \Widgets\Textarea();
         $textareaWidget->setTextareaClass("mce-small");
         $textareaWidget->setWidth("600");
         $textareaWidget->setData($pyramidPosition);
         $textareaWidget->setContentProvider(\Widgets\DataProvider::contentProvider());
         $dialog->addWidget($textareaWidget);
         $dialog->addWidget($clearer);
         $ajaxResponseObject->addWidget($dialog);
         $ajaxResponseObject->setStatus("ok");
         return $ajaxResponseObject;
     }
 }
Example #5
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Erstelle ein neues Portfolio");
        $textInput = new \Widgets\TextInput();
        $ajaxForm = new \Widgets\AjaxForm();
        $ajaxForm->addWidget($textInput);
        $ajaxForm->setSubmitCommand("CreatePortfolio");
        $ajaxForm->setSubmitNamespace("Portfolio");
        $ajaxForm->setHtml(<<<END
\t<div id="wizard_wrapper">
\t<input type="hidden" name="id" value="{$this->id}">
\t<div class="widgets_lable">Name:</div>
\t<div class="widgets_textinput"><input type="text" value="" name="name"></div><br clear="all">
\t<div class="widgets_lable">Beschreibung:</div>
\t<div class="widgets_textinput"><input type="text" value="" name="desc"></div><br clear="all">
\t</div>
END
);
        $dialog->addWidget($ajaxForm);
        $ajaxResponseObject->addWidget($dialog);
        return $ajaxResponseObject;
        /*
        $ajaxUploader = new \Widgets\AjaxUploader();
        $ajaxUploader->setSizeLimit(return_bytes(ini_get('post_max_size')));
        $ajaxUploader->setBackend(PATH_URL . "explorer/");
        $ajaxUploader->setEnvId($this->id);
        //ROLF
        $ajaxUploader->setCommand("Upload");
        $ajaxUploader->setNamespace("Portfolio");
        $ajaxResponseObject->addWidget($ajaxUploader);
        */
    }
Example #6
0
 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;
 }
Example #7
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Erstelle ein neues Artefakt");
        $dialog->setCloseButtonLabel(null);
        $submitCommand = "CreateArtefact";
        $submitNamespace = "Portfolio";
        $html = "<div id=\"wizard\" style=\"margin-left: 20px; margin-right: 20px\">";
        $html .= <<<END
\t<form id="ajaxform" onsubmit="sendAjaxFrom(); return false;">
\t\t<input type="hidden" name="id" value="{$this->id}">
\t\t<div class="widgets_lable">Titel:</div>
\t\t<div class="widgets_textinput"><input type="text" value="" name="name"></div><br clear="all">
\t\t<div class="widgets_lable">Beschreibung:</div>
\t\t<div class="widgets_textinput"><input type="text" value="" name="desc"></div><br clear="all">
\t</form>
\t<script>
\tfunction sendAjaxFrom() {
\t\tform = formToObject("ajaxform");
\t\tsendRequest("{$submitCommand}", form, "wizard", "wizard", null, null, "{$submitNamespace}"); 
\t}
\t</script>
END;
        $html .= "<div style=\"float:right\"><a href=\"#\" class=\"button pill left\" onclick=\"sendAjaxFrom(); return false;\"><b>Weiter</b></a><a class=\"button pill negative\" onclick=\"closeDialog();return false;\" href=\"#\">Abbrechen</a></div></div>";
        $rawHtml = new \Widgets\RawHtml();
        $rawHtml->setHtml($html);
        $dialog->addWidget($rawHtml);
        $ajaxResponseObject->addWidget($dialog);
        return $ajaxResponseObject;
    }
Example #8
0
 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;
 }
Example #9
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Erstelle neues Thema in »" . getCleanName($object) . "«");
        $ajaxForm = new \Widgets\AjaxForm();
        $ajaxForm->setSubmitCommand("CreateTopic");
        $ajaxForm->setSubmitNamespace("Forum");
        $ajaxForm->setHtml(<<<END
\t<input type="hidden" name="id" value="{$this->id}">
\t<div class="widgets_lable">Überschrift:</div>
\t<div class="widgets_textinput"><input type="text" value="" name="title"></div><br clear="all">
\t<div class="widgets_lable">Inhalt:</div>
\t<div class="widgets_textarea"><textarea rows="10" style="width:100%" class="mce-small"  value="" name="content" id="content"></textarea><br clear="all">
\t<script type="text/javascript">
\t\t    \tvar mce_defaults = {
\t    \t\t\tmode : "specific_textareas",
\t    \t\t\t
\t    \t\t\t// General options
\t\t\t\t\ttheme : "advanced",
\t\t\t\t\tcontent_css : "{PATH_URL}widgets/css/tinymce.css",
\t\t\t\t\tskin: "o2k7",
\t\t\t\t\tremove_linebreaks: false,
\t\t\t\t    convert_urls : false,
\t\t\t\t    verify_html: "false",
\t\t\t\t\tlanguage: "de",
\t\t\t\t\t
\t\t\t\t\t// Theme options
\t\t\t\t\ttheme_advanced_buttons3 : "",
\t\t\t\t\ttheme_advanced_buttons4 : "",
\t\t\t\t\ttheme_advanced_toolbar_location : "top",
\t\t\t\t\ttheme_advanced_toolbar_align : "left",
\t\t\t\t\ttheme_advanced_statusbar_location : "none",
\t\t\t\t\ttheme_advanced_resizing : false,
\t\t\t\t\t
\t    \t};
\t    \t
\t    \t
\t    \t\tload("mce", function() {
\t\t\t\t\ttinyMCE.init(\$.extend({
\t\t\t\t\t\teditor_selector: "mce-small", 
\t\t\t\t\t\tplugins : "emotions,paste,noneditable",
\t\t\t\t\t\t// Theme options
\t\t\t\t\t\ttheme_advanced_buttons1 : "bold,italic,underline,|,bullist,numlist,|,link,unlink,|,forecolor,removeformat,|,undo,redo,pasteword",
\t\t\t\t\t\ttheme_advanced_buttons2 : ""
\t\t\t\t\t}, mce_defaults));
\t    \t\t});
\t

\t</script>
END
);
        $dialog->addWidget($ajaxForm);
        $dialog->setCloseButtonLabel(null);
        $ajaxResponseObject->setStatus("ok");
        $ajaxResponseObject->addWidget($dialog);
        return $ajaxResponseObject;
    }
Example #10
0
 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;
 }
Example #11
0
 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;
 }
Example #12
0
 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;
 }
Example #13
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
        $ajaxForm = new \Widgets\AjaxForm();
        $ajaxForm->setSubmitCommand("CreateFolder");
        $ajaxForm->setSubmitNamespace("Bookmarks");
        $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">Ordnername:</div>
\t<div class="attributeValue"><input type="text" class="text" value="" name="name"></div>
</div>
<br>
END
);
        $ajaxResponseObject->setStatus("ok");
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Erstelle neuen Ordner in »" . "Lesezeichen" . "«");
        $dialog->addWidget($ajaxForm);
        $dialog->setCloseButtonLabel(null);
        $ajaxResponseObject->addWidget($dialog);
        //$idRequestObject = new \IdRequestObject();
        //$idRequestObject->setId($this->id);
        return $ajaxResponseObject;
    }
Example #14
0
 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"));
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget(new \Widgets\Clearer());
     $align = new \Widgets\ComboBox();
     $align->setLabel("Sortierung");
     $align->setOptions(array(array("name" => "Frühe Termine zuerst anzeigen", "value" => "earliest_first"), array("name" => "Späte Termine zuerst anzeigen", "value" => "latest_first")));
     $align->setData($object);
     $align->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:app:app_order"));
     $dialog->addWidget($align);
     $this->dialog = $dialog;
 }
Example #15
0
 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;
 }
Example #16
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $ajaxDialog = new \Widgets\Dialog();
     $ajaxDialog->setTitle("Neue Bilder hinzufügen");
     $ajaxUploader = new \Widgets\AjaxUploader();
     $ajaxUploader->setNamespace("explorer");
     $ajaxUploader->setDestId($this->id);
     $ajaxDialog->addWidget($ajaxUploader);
     $ajaxResponseObject->addWidget($ajaxDialog);
     return $ajaxResponseObject;
 }
Example #17
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;
 }
Example #18
0
 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;
 }
Example #19
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;
 }
Example #20
0
    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;
    }
Example #21
0
 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;
 }
Example #22
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $dialog = new \Widgets\Dialog();
        $dialog->setTitle("Erstelle ein neues Artefakt");
        $textInput = new \Widgets\TextInput();
        $ajaxForm = new \Widgets\AjaxForm();
        $ajaxForm->addWidget($textInput);
        $ajaxForm->setSubmitCommand("CreateArtefactCertificate");
        $ajaxForm->setSubmitNamespace("Portfolio");
        $ajaxForm->setHtml(<<<END
\t<div id="wizard">
\t\t<input type="hidden" name="id" value="{$this->id}">
\t\t<div class="widgets_lable">Titel:</div>
\t\t<div class="widgets_textinput"><input type="text" value="" name="name"></div><br clear="all">
\t\t<div class="widgets_lable">Beschreibung:</div>
\t\t<div class="widgets_textinput"><input type="text" value="" name="desc"></div><br clear="all">
\t</div>
END
);
        $dialog->addWidget($ajaxForm);
        $ajaxResponseObject->addWidget($dialog);
        return $ajaxResponseObject;
    }
Example #23
0
 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;
 }
Example #24
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $forumId = $this->params["forum"];
     $objectId = $this->id;
     $steam = $GLOBALS["STEAM"];
     $steamId = $steam->get_id();
     $forum = \steam_factory::get_object($steamId, $forumId);
     /** log-in user */
     $steamUser = \lms_steam::get_current_user();
     /** id of the log-in user */
     $steamUserId = $steamUser instanceof \steam_user ? $steamUser->get_id() : 0;
     /** the current category object */
     $object = \steam_factory::get_object($steamId, $objectId);
     /** the content of the category object */
     $object_content = $object->get_content(1);
     /** additional required attributes */
     $attrib = $object->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, OBJ_LAST_CHANGED, "bid:description"), 1);
     /* get the annotating forum object */
     $forum = $object->get_annotating(1);
     /** check the rights of the log-in user */
     $allowed_write = $object->check_access_write($steamUser, 1);
     // flush the buffer
     $result = $steam->buffer_flush();
     $object_content = $result[$object_content];
     $attrib = $result[$attrib];
     $forum = $result[$forum];
     $allowed_write = $result[$allowed_write];
     $forum_attrib = $forum->get_attributes(array(OBJ_NAME, OBJ_DESC, "bid:description"), 1);
     $result = $steam->buffer_flush();
     $forum_attrib = $result[$forum_attrib];
     $content = $object_content;
     $title = $attrib[OBJ_DESC];
     $description = isset($attrib["bid:description"]) ? $attrib["bid:description"] : "";
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Bearbeite aktuelles Thema »" . getCleanName($object) . "«");
     $clearer = new \Widgets\Clearer();
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $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);
     /*$widget = new \Widgets\Checkbox();
     		$widget->setLabel("Benutzer dürfen ihre Antworten bearbeiten");
     		$widget->setData($object);
     		$widget->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:forum:is_editable"));
     		$widget->setCheckedValue("checked");
     		$widget->setUncheckedValue("");
     		$dialog->addWidget($widget);*/
     /*	$ajaxForm = new \Widgets\AjaxForm();
     		$ajaxForm->setSubmitCommand("EditTopicContent");
     		$ajaxForm->setSubmitNamespace("Forum");
     
     		$ajaxForm->setHtml(<<<END
     	<input type="hidden" name="id" value="{$this->id}">
     	
     	
     	<div class="widgets_lable">Überschrift:</div>
     	<div class="widgets_textinput"><input type="text" value="{$title}" name="title"></div><br clear="all">
     	<div class="widgets_lable">Inhalt:</div>
     	<div class="widgets_textarea"><textarea rows="10" style="width:100%" class="tinymce"  value="{$content}" name="content1" id="content1"></textarea><br clear="all">
     	
     END
     		);
     			
     		$dialog->addWidget($ajaxForm);*/
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($dialog);
     return $ajaxResponseObject;
 }
Example #25
0
 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;
 }
Example #26
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;
 }
Example #27
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $object_id = $this->id;
     $steam = $GLOBALS["STEAM"];
     $steamId = $steam->get_id();
     /** log-in user */
     $steamUser = \lms_steam::get_current_user();
     /** id of the log-in user */
     $steamUserId = $steamUser->get_id();
     /** name of the log-in user */
     $steamUserName = $steamUser->get_name();
     /** the current object */
     $object = \steam_factory::get_object($steamId, $object_id);
     /** the content of the message object */
     $object_content = $object->get_content(1);
     /** additional required attributes */
     $attrib = $object->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME, OBJ_LAST_CHANGED), 1);
     /** get the annotating category */
     $category = $object->get_annotating(1);
     /** check the rights of the log-in user */
     $allowed_write = $object->check_access_write($steamUser, 1);
     // flush the buffer
     $result = $steam->buffer_flush();
     $object_content = $result[$object_content];
     $attrib = $result[$attrib];
     $category = $result[$category];
     $allowed_write = $result[$allowed_write];
     $category_attributes = $category->get_attributes(array(OBJ_NAME, OBJ_DESC), 1);
     $result = $steam->buffer_flush();
     $category_attributes = $result[$category_attributes];
     $content = $object_content;
     $title = $attrib[OBJ_DESC];
     $dialog = new \Widgets\Dialog();
     $dialog->setTitle("Bearbeite aktuelles Thema »" . getCleanName($object) . "«");
     $clearer = new \Widgets\Clearer();
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $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);
     /*$ajaxForm = new \Widgets\AjaxForm();
     		 $ajaxForm->setSubmitCommand("EditReplyContent");
     		 $ajaxForm->setSubmitNamespace("Forum");
     
     		 $ajaxForm->setHtml(<<<END
     		 <input type="hidden" name="id" value="{$this->id}">
     		 <input type="hidden" name="forum" value="{$this->params["forum"]}">
     		 <div class="widgets_lable">Überschrift:</div>
     		 <div class="widgets_textinput"><input type="text" value="{$title}" name="title"></div><br clear="all">
     		 <div class="widgets_lable">Inhalt:</div>
     		 <div class="widgets_textarea"><textarea rows="10" style="width:100%" class="tinymce"  value="{$content}" name="content1" id="content1"></textarea><br clear="all">
     		 <input id="content_id" type="hidden" name="content" value="">
     		 <script type="text/javascript">
     		 tinyMCE.init({
     		 mode : "textareas",
     
     		 // General options
     		 theme : "advanced",
     		 skin: "o2k7",
     		 id: "content1",
     		 name:"content1",
     		 force_br_newlines : true,
     		 force_p_newlines : false,
     		 forced_root_block : '',
     
     		 language: "de",
     		 plugins : "emotions,paste",
     
     			//Specific options
     			setup : function(ed) {
     			ed.onKeyUp.add(function(ed, o) {
     			var content = "<p>"+ed.getContent()+"</p>";
     			$("#content_id").val(content);
     			});
     			ed.onInit.add(function(ed) {
     			ed.setContent('{$content}');
     			});
     
     			},
     
     			// Theme options
     			theme_advanced_buttons1 : "bold,italic,underline,|,image,link,unlink,|,forecolor,removeformat,|,undo,redo,pasteword,|,code",
     			theme_advanced_buttons2 : "",
     			theme_advanced_buttons3 : "",
     			theme_advanced_buttons4 : "",
     			theme_advanced_toolbar_location : "top",
     			theme_advanced_toolbar_align : "left",
     			theme_advanced_statusbar_location : "none",
     			theme_advanced_resizing : false
     			});
     
     			</script>
     			END
     			);
     			$dialog->addWidget($ajaxForm);*/
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($dialog);
     return $ajaxResponseObject;
 }
Example #28
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;
 }
Example #29
0
 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"));
     $clearer = new \Widgets\Clearer();
     $titelInput = new \Widgets\TextInput();
     $titelInput->setLabel("Überschrift");
     $titelInput->setData($object);
     $titelInput->setContentProvider(\Widgets\DataProvider::attributeProvider("OBJ_DESC"));
     $dialog->addWidget($titelInput);
     $dialog->addWidget($clearer);
     $descriptionInput = new \Widgets\TextInput();
     $descriptionInput->setLabel("Beschreibung");
     $descriptionInput->setData($object);
     $descriptionInput->setContentProvider(\Widgets\DataProvider::attributeProvider("bid:portlet:content([poll_topic])"));
     $dialog->addWidget($descriptionInput);
     $dialog->addWidget($clearer);
     //datepicker
     $datepickerStart = new \Widgets\DatePicker();
     $datepickerStart->setLabel("Start der Abstimmung");
     $datepickerStart->setData($object);
     $datepickerStart->setContentProvider(new AttributeDataProviderPortletTermplanDates("start_date"));
     $dialog->addWidget($datepickerStart);
     $dialog->addWidget($clearer);
     $datepickerEnd = new \Widgets\DatePicker();
     $datepickerEnd->setLabel("Ende der Abstimmung");
     $datepickerEnd->setData($object);
     $datepickerEnd->setContentProvider(new AttributeDataProviderPortletTermplanDates("end_date"));
     $dialog->addWidget($datepickerEnd);
     $dialog->addWidget($clearer);
     $termLabelWidth = 50;
     $termInputWidth = 300;
     //term descriptions
     $term0 = new \Widgets\TextInput();
     $term0->setLabelWidth($termLabelWidth);
     $term0->setInputWidth($termInputWidth);
     $term0->setLabel("Eintrag 1");
     $term0->setData($object);
     $term0->setContentProvider(new AttributeDataProviderPortletTermplanEntries("0"));
     $dialog->addWidget($term0);
     $dialog->addWidget($clearer);
     $term1 = new \Widgets\TextInput();
     $term1->setLabelWidth($termLabelWidth);
     $term1->setInputWidth($termInputWidth);
     $term1->setLabel("Eintrag 2");
     $term1->setData($object);
     $term1->setContentProvider(new AttributeDataProviderPortletTermplanEntries("1"));
     $dialog->addWidget($term1);
     $dialog->addWidget($clearer);
     $term2 = new \Widgets\TextInput();
     $term2->setLabelWidth($termLabelWidth);
     $term2->setInputWidth($termInputWidth);
     $term2->setLabel("Eintrag 3");
     $term2->setData($object);
     $term2->setContentProvider(new AttributeDataProviderPortletTermplanEntries("2"));
     $dialog->addWidget($term2);
     $dialog->addWidget($clearer);
     $term3 = new \Widgets\TextInput();
     $term3->setLabelWidth($termLabelWidth);
     $term3->setInputWidth($termInputWidth);
     $term3->setLabel("Eintrag 4");
     $term3->setData($object);
     $term3->setContentProvider(new AttributeDataProviderPortletTermplanEntries("3"));
     $dialog->addWidget($term3);
     $dialog->addWidget($clearer);
     $term4 = new \Widgets\TextInput();
     $term4->setLabelWidth($termLabelWidth);
     $term4->setInputWidth($termInputWidth);
     $term4->setLabel("Eintrag 5");
     $term4->setData($object);
     $term4->setContentProvider(new AttributeDataProviderPortletTermplanEntries("4"));
     $dialog->addWidget($term4);
     $dialog->addWidget($clearer);
     $term5 = new \Widgets\TextInput();
     $term5->setLabelWidth($termLabelWidth);
     $term5->setInputWidth($termInputWidth);
     $term5->setLabel("Eintrag 6");
     $term5->setData($object);
     $term5->setContentProvider(new AttributeDataProviderPortletTermplanEntries("5"));
     $dialog->addWidget($term5);
     $dialog->addWidget($clearer);
     $this->dialog = $dialog;
 }
Example #30
0
    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;
    }