public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     if (isset($this->params["categoryIndex"]) && isset($this->params["value"])) {
         $data = array();
         $oldValue = $this->getEntryField($this->object, $this->categoryIndex, $this->entryIndex, $this->field);
         try {
             $this->setEntryField($this->object, $this->categoryIndex, $this->entryIndex, $this->field, $this->value);
         } catch (steam_exception $e) {
             $data["oldValue"] = $oldValue;
             $data["error"] = $e->get_message();
             $data["undo"] = false;
             $ajaxResponseObject->setStatus("ok");
             $ajaxResponseObject->setData($data);
             return $ajaxResponseObject;
         }
         $ajaxResponseObject->setStatus("ok");
         $newValue = $this->getEntryField($this->object, $this->categoryIndex, $this->entryIndex, $this->field);
         if ($newValue === $this->params["value"]) {
             $data["oldValue"] = $oldValue;
             $data["newValue"] = $newValue;
             $data["error"] = "none";
             $data["undo"] = true;
         } else {
             $data["oldValue"] = $oldValue;
             $data["error"] = "Data could not be saved.";
             $data["undo"] = false;
         }
         $ajaxResponseObject->setData($data);
     } else {
         $ajaxResponseObject->setStatus("error");
     }
     return $ajaxResponseObject;
 }
Пример #2
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     if (!isset($this->id)) {
         $ajaxResponseObject->setStatus("ok");
         $jswrapper = new \Widgets\JSWrapper();
         $ids = "";
         $elements = "";
         foreach ($this->elements as $key => $element) {
             if (count($this->elements) > $key + 1) {
                 $ids .= "{\"id\":\"" . $element->get_id() . "\", \"env\":\"" . $this->env . "\"}, ";
                 $elements .= "\"\", ";
             } else {
                 $ids .= "{\"id\":\"" . $element->get_id() . "\", \"env\":\"" . $this->env . "\"}";
                 $elements .= "\"\"";
             }
         }
         $js = "sendMultiRequest('Paste', jQuery.parseJSON('[{$ids}]'), jQuery.parseJSON('[{$elements}]'), 'updater', null, null, 'explorer', 'Füge Objekt ein ...', 0, " . count($this->elements) . ");";
         $jswrapper->setJs($js);
         $ajaxResponseObject->addWidget($jswrapper);
         return $ajaxResponseObject;
     } else {
         $ajaxResponseObject->setStatus("ok");
         $clipboardModel = new \Explorer\Model\Clipboard($this->clipboard);
         $jswrapper = new \Widgets\JSWrapper();
         $js = "document.getElementById('clipboardIconbarWrapper').innerHTML = '" . $clipboardModel->getIconbarHtml() . "';";
         if (count($this->clipboard->get_inventory()) == 0) {
             $js .= "window.location.reload();";
         }
         $jswrapper->setJs($js);
         $ajaxResponseObject->addWidget($jswrapper);
         return $ajaxResponseObject;
     }
 }
Пример #3
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;
     }
 }
Пример #4
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;
    }
Пример #5
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;
 }
Пример #6
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;
 }
Пример #7
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     //    <img src=\"{$editIcon}\">
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTopic", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Kategorie einfügen <img src=\"{$blankIcon}\">", "command" => "CreateCategory", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'last'}", "type" => "popup"))), array("name" => "SEPARATOR"), array("name" => "Kopieren <img src=\"{$copyIcon}\">", "command" => "PortletCopy", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Ausschneiden <img src=\"{$cutIcon}\">", "command" => "PortletCut", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Referenzieren <img src=\"{$referIcon}\">", "command" => "PortletReference", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'******'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "SEPARATOR"), array("name" => "Rechte <img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "Explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
Пример #8
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Bild bearbeiten <img src=\"{$blankIcon}\">", "command" => "EditMessageImage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'last'}", "type" => "popup"))), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
Пример #9
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $order = json_decode($this->order);
     if (is_array($order)) {
         $worksheet = new \Worksheet\Worksheet($this->id);
         $blocks = $worksheet->getBlocks();
         if ($blocks and count($blocks) > 0) {
             foreach ($blocks as $block) {
                 /* get position of current block in posted order */
                 $key = array_search($block->getId(), $order);
                 if ($key !== false) {
                     /* use the found key for order attribute */
                     $block->setOrder($key);
                 } else {
                     /* current blocks id was not found in posted order */
                     $block->setOrder(-1);
                 }
             }
         }
     }
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml("");
     $ajaxResponseObject->addWidget($rawHtml);
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }
Пример #10
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);
        */
    }
Пример #11
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $data = json_decode($this->data);
     if (is_array($data)) {
         $worksheet = new \Worksheet\Worksheet($this->id);
         if ($worksheet->getStatus() == 1) {
             $blocks = $worksheet->getBlocks();
             if ($blocks and count($blocks) > 0) {
                 $i = 0;
                 foreach ($blocks as $block) {
                     $d = array();
                     foreach ($data[$i] as $key => $value) {
                         $d[$key] = $value;
                     }
                     $block->setSolution($d);
                     $i++;
                 }
             }
         }
     }
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml("");
     $ajaxResponseObject->addWidget($rawHtml);
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }
Пример #12
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     //icons
     $copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
     $cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
     $referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
     $deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
     $hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
     $bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
     $schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
     $upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
     $downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
     $topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
     $bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
     $renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
     $editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
     $propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
     $rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
     $blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
Пример #13
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml(\Bookmarks\Model\Bookmark::getMarkerHtml($this->id));
     $ajaxResponseObject->addWidget($rawHtml);
     return $ajaxResponseObject;
 }
Пример #14
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $ajaxForm = new \Widgets\AjaxForm();
        $ajaxForm->setSubmitCommand("Create");
        $ajaxForm->setSubmitNamespace("Wave");
        $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;
}

.attributeNameRequired {
  float: left;
  padding-right: 20px;
  text-align: right;
  font-weight: bold;
  width: 80px;
}

.attributeValue {
  float: left;
  width: 300px;
}

.attributeValue .text, .attributeValue textarea {
  wwidth: 100px;
}

.attributeValueColumn {
  float: left;
  position: relative;
  text-align: center;
}
</style>
<hr>
<input type="hidden" name="id" value="{$this->id}">
<div class="attribute">
\t<div class="attributeNameRequired">Titel*:</div>
\t<div><input type="text" class="text" value="" name="title"></div>
</div>
<div class="attribute">
\t<div class="attributeNameRequired">Slogen:</div>
\t<div><input type="text" class="text" value="" name="slogan"></div>
</div>
END
);
        $ajaxResponseObject->addWidget($ajaxForm);
        return $ajaxResponseObject;
    }
Пример #15
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;
    }
Пример #16
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $user = $GLOBALS["STEAM"]->get_current_steam_user();
        if (!isset($this->params["group_course"])) {
            $rawWidget = new \Widgets\RawHtml();
            $rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
            $ajaxResponseObject->addWidget($rawWidget);
            return $ajaxResponseObject;
        }
        if ($this->params["group_course"] == 1) {
            if (!isset($this->params["course"])) {
                $rawWidget = new \Widgets\RawHtml();
                $rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
                $ajaxResponseObject->addWidget($rawWidget);
                return $ajaxResponseObject;
            }
            $course = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["course"]);
            $subgroups = $course->get_subgroups();
            foreach ($subgroups as $subgroup) {
                if ($subgroup->get_name() == "learners") {
                    $group = $subgroup;
                }
                if ($subgroup->get_name() == "staff") {
                    $staffgroup = $subgroup;
                }
            }
        } else {
            if (!isset($this->params["group"])) {
                $rawWidget = new \Widgets\RawHtml();
                $rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
                $ajaxResponseObject->addWidget($rawWidget);
                return $ajaxResponseObject;
            }
            $group = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["group"]);
            if ($this->params["group_admin"] == 0) {
                $staffgroup = $user;
            } else {
                $staffgroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["group_admin"]);
            }
        }
        // create data structure and set access rights
        $rapidfeedback = \steam_factory::create_room($GLOBALS["STEAM"]->get_id(), $this->params["title"], $group->get_workroom(), $this->params["desc"]);
        $rapidfeedback->set_attribute("OBJ_TYPE", "RAPIDFEEDBACK_CONTAINER");
        $rapidfeedback->set_attribute("RAPIDFEEDBACK_GROUP", $group);
        $rapidfeedback->set_attribute("RAPIDFEEDBACK_STAFF", $staffgroup);
        $rapidfeedback->set_attribute("RAPIDFEEDBACK_ADMIN_SURVEY", 1);
        $rapidfeedback->set_sanction_all($group);
        $rapidfeedback->set_sanction_all($staffgroup);
        $ajaxResponseObject->setStatus("ok");
        $jswrapper = new \Widgets\JSWrapper();
        $jswrapper->setJs(<<<END
\t\tcloseDialog();
END
);
        $ajaxResponseObject->addWidget($jswrapper);
        return $ajaxResponseObject;
    }
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $user = \lms_steam::get_current_user();
     $description = strip_tags($this->params["desc"]);
     $name = strip_tags($this->params["name"]);
     $newArtefact = \ArtefactCertificate::create($name, $description);
     return parent::ajaxResponseNew($ajaxResponseObject, $newArtefact);
 }
Пример #18
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $jswrapper = new \Widgets\JSWrapper();
     $js = "console.log('start');\n\t\t\t   if (jQuery('#explorerWrapper').length == 0) {\n\t\t\t   \tlocation.reload();\n\t\t\t   } else {\n\t\t\t  \t var element = jQuery('#{$this->id}');\n\t\t\t\t   if ('{$this->direction}' == 'up') {\n\t\t\t\t\t\telement.insertBefore(element.prev());\n\t\t\t\t   } else if ('{$this->direction}' == 'down') {\n\t\t\t\t\t\telement.insertAfter(element.next());\n\t\t\t\t   } else if ('{$this->direction}' == 'top') {\n\t\t\t\t   \t\telement.insertBefore(element.parent().children().first());\n\t\t\t\t   } else if ('{$this->direction}' == 'bottom') {\n\t\t\t\t   \t\telement.insertAfter(element.parent().children().last());\n\t\t\t\t   }\n\t\t\t   }\n\t\t       console.log('DOnE');";
     $jswrapper->setJs($js);
     $ajaxResponseObject->addWidget($jswrapper);
     return $ajaxResponseObject;
 }
Пример #19
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $jswrapper = new \Widgets\JSWrapper();
     $js = "jQuery('#{$this->id}').removeClass('red orange yellow green blue purple grey transparent').addClass('{$this->color}');";
     $jswrapper->setJs($js);
     $ajaxResponseObject->addWidget($jswrapper);
     return $ajaxResponseObject;
 }
Пример #20
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $jswrapper = new \Widgets\JSWrapper();
     $clipboardModel = new \Explorer\Model\Clipboard($this->user);
     $js = "\n\t\t if (jQuery('#explorerWrapper').length == 0) {\n\t\t\t   \tlocation.reload();\n\t\t\t   }\n\t\t else{\n\t\t       jQuery('#{$this->id}').remove();document.getElementById('clipboardIconbarWrapper').innerHTML = '" . $clipboardModel->getIconbarHtml() . "';\n\t\t\t}";
     $jswrapper->setJs($js);
     $ajaxResponseObject->addWidget($jswrapper);
     return $ajaxResponseObject;
 }
Пример #21
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $jswrapper = new \Widgets\JSWrapper();
     $clipboardModel = new \Explorer\Model\Clipboard($this->user);
     $js = "document.getElementById('clipboardIconbarWrapper').innerHTML = '" . $clipboardModel->getIconbarHtml() . "';";
     $jswrapper->setJs($js);
     $ajaxResponseObject->addWidget($jswrapper);
     return $ajaxResponseObject;
 }
Пример #22
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $current_container = \ArtefactModel::getArtefactsContainer();
     $ajaxUploader = new \Widgets\AjaxUploader();
     //$ajaxUploader->setBackend(PATH_URL . "explorer/");
     $ajaxUploader->setEnvId($current_container->get_id());
     $ajaxResponseObject->addWidget($ajaxUploader);
     return $ajaxResponseObject;
 }
Пример #23
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $ajaxResponseObject->setStatus("ok");
     $jswrapper = new \Widgets\JSWrapper();
     $trashbinModel = new \Explorer\Model\Trashbin($this->trashbin);
     $js = "jQuery('#{$this->id}').addClass('justTrashed').removeClass('listviewer-item-selected').find('input:checkbox').attr('disabled', 'disabled');\n\t\t\t   var checkbox = document.getElementById('{$this->id}_checkbox');\n\t\t\t   if (!checkbox) {\n\t\t\t   \t\tlocation.reload();\n\t\t\t   } else {\n\t\t\t   \tcheckbox.checked = false;\n\t\t\t   \tdocument.getElementById('{$this->id}').onclick_restore = document.getElementById('{$this->id}').onclick;\n\t\t\t   \tdocument.getElementById('{$this->id}').onclick = \"\";\n\t\t       \tdocument.getElementById('trashbinIconbarWrapper').innerHTML = '" . $trashbinModel->getIconbarHtml() . "';\n\t\t\t   }";
     $jswrapper->setJs($js);
     $ajaxResponseObject->addWidget($jswrapper);
     return $ajaxResponseObject;
 }
Пример #24
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     /* get the sample text for a block identified by $this->id */
     $block = new \Worksheet\Block($this->id);
     $value = $block->getSampleText();
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($value);
     $ajaxResponseObject->addWidget($rawHtml);
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }
Пример #25
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;
    }
Пример #26
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $popupMenu = new \Widgets\PopupMenu();
     $items = array(array("name" => "Komponente erstellen", "command" => "NewPortlet", "namespace" => "PortalColumn", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Komponente aus Zwischenablage", "command" => "InsertPortlet", "namespace" => "PortalColumn", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Spaltenbreite bearbeiten", "command" => "Edit", "namespace" => "PortalColumn", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"));
     $popupMenu->setItems($items);
     $popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
     $popupMenu->setWidth("150px");
     $ajaxResponseObject->setStatus("ok");
     $ajaxResponseObject->addWidget($popupMenu);
     return $ajaxResponseObject;
 }
Пример #27
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $portfolio = \PortfolioModel::getById($this->portfolioId);
     if ($this->checked == "true") {
         $portfolio->addArtefact($this->artefact);
     } else {
         $portfolio->removeArtefact($this->artefact);
     }
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }
Пример #28
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $competence = \CompetenceRaster::getCompetenceById($this->competenceId);
     if ($this->checked == "true") {
         $this->artefact->addCompetenceString($this->competenceId);
     } else {
         $this->artefact->removeCompetenceString($this->competenceId);
     }
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }
Пример #29
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $jswrapper = new \Widgets\JSWrapper();
        $jswrapper->setJs(<<<END
\t\twindow.location.reload();
END
);
        $ajaxResponseObject->addWidget($jswrapper);
        return $ajaxResponseObject;
    }
Пример #30
0
 public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
 {
     $block = new \Worksheet\Block($this->id);
     $block->setSampleDisplayed();
     $value = "ok";
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($value);
     $ajaxResponseObject->addWidget($rawHtml);
     $ajaxResponseObject->setStatus("ok");
     return $ajaxResponseObject;
 }