29 protected \ILIAS\DI\UIServices
$ui;
30 protected \ilLanguage
$lng;
39 $this->
ui = $DIC->ui();
40 $this->
lng = $DIC->language();
42 $this->
user = $DIC->user();
49 switch ($body[
"action"]) {
54 return $this->updateCommand($body);
57 throw new Exception(
"Unknown action " . $body[
"action"]);
63 $page = $this->page_gui->getPageObject();
68 if (!in_array($body[
"after_pcid"], [
"",
"pg"])) {
69 $hier_ids = $page->getHierIdsForPCIds([$body[
"after_pcid"]]);
70 $hier_id = $hier_ids[$body[
"after_pcid"]];
71 $pc_id = $body[
"after_pcid"];
76 $pc_media = new \ilPCMediaObject($page);
77 $pc_media->createMediaObject();
78 $mob = $pc_media->getMediaObject();
80 $mob_gui = new \ilObjMediaObjectGUI(
"");
81 $mob_gui->initForm(
"create");
82 if ($mob_gui->checkFormInput()) {
83 $mob_gui->setObjectPerCreationForm($mob);
84 $media_item = $mob->getMediaItem(
"Standard");
85 if (!is_null($media_item)) {
86 $pc_media->createAlias($page, $hier_id, $pc_id);
90 if ($mob_gui->getForm()->getInput(
"standard_type") ===
"File") {
91 $edit_gui = new \ilPCMediaObjectEditorGUI();
92 $form = $edit_gui->getUploadForm($lng);
94 $form->setValuesByPost();
95 $rendered_form = $edit_gui->getRenderedUploadForm(
100 return $this->ui_wrapper->sendFormError($rendered_form);
102 $edit_gui = new \ilPCMediaObjectEditorGUI();
103 $form = $edit_gui->getUrlForm($lng);
105 $form->setValuesByPost();
106 $rendered_form = $edit_gui->getRenderedUrlForm(
111 return $this->ui_wrapper->sendFormError($rendered_form);
116 return $this->ui_wrapper->sendPage($this->page_gui,
$updated);
121 $page = $this->page_gui->getPageObject();
124 $pc_media = $page->getContentObjectForPcId($body[
"pcid"]);
125 $quick_edit = new \ilPCMediaObjectQuickEdit($pc_media);
131 $quick_edit->setUseFullscreen((
bool) ($body[
"fullscreen"] ??
false));
135 $pc_media->getMediaObject()->update();
138 return $this->ui_wrapper->sendPage($this->page_gui,
$updated);
insertCommand(array $body)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Command action handler interface.
Server UIWrapper $ui_wrapper
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilPageObjectGUI $page_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPageObjectGUI $page_gui
handle(array $query, array $body)