19 declare(strict_types=1);
    31     protected \ILIAS\DI\UIServices 
$ui;
    32     protected \ilLanguage 
$lng;
    41         $this->
ui = $DIC->ui();
    42         $this->
lng = $DIC->language();
    44         $this->
user = $DIC->user();
    46         $this->ui_wrapper = 
new Server\UIWrapper($this->
ui, $this->
lng);
    51         switch ($body[
"action"]) {
    56                 return $this->updateCommand($body);
    59                 throw new Exception(
"Unknown action " . $body[
"action"]);
    65         $page = $this->page_gui->getPageObject();
    70         if (!in_array($body[
"after_pcid"], [
"", 
"pg"])) {
    71             $hier_ids = $page->getHierIdsForPCIds([$body[
"after_pcid"]]);
    72             $hier_id = $hier_ids[$body[
"after_pcid"]];
    73             $pc_id = $body[
"after_pcid"];
    78         $pc_media = new \ilPCMediaObject($page);
    79         $pc_media->createMediaObject();
    80         $mob = $pc_media->getMediaObject();
    82         $mob_gui = new \ilObjMediaObjectGUI(
"");
    83         $mob_gui->initForm(
"create");
    84         if ($mob_gui->checkFormInput()) {
    85             $mob_gui->setObjectPerCreationForm($mob);
    86             $media_item = $mob->getMediaItem(
"Standard");
    87             if (!is_null($media_item)) {
    88                 $pc_media->createAlias($page, $hier_id, $pc_id);
    92             if ($mob_gui->getForm()->getInput(
"standard_type") === 
"File") {
    93                 $edit_gui = new \ilPCMediaObjectEditorGUI();
    94                 $form = $edit_gui->getUploadForm($lng);
    96                 $form->setValuesByPost();
    97                 $rendered_form = $edit_gui->getRenderedUploadForm(
   102                 return $this->ui_wrapper->sendFormError($rendered_form);
   104                 $edit_gui = new \ilPCMediaObjectEditorGUI();
   105                 $form = $edit_gui->getUrlForm($lng);
   107                 $form->setValuesByPost();
   108                 $rendered_form = $edit_gui->getRenderedUrlForm(
   113                 return $this->ui_wrapper->sendFormError($rendered_form);
   118         return $this->ui_wrapper->sendPage($this->page_gui, 
$updated);
   121     protected function updateCommand(array $body): Server\Response
   123         $page = $this->page_gui->getPageObject();
   126         $pc_media = $page->getContentObjectForPcId($body[
"pcid"]);
   127         $quick_edit = new \ilPCMediaObjectQuickEdit($pc_media);
   133         $quick_edit->setUseFullscreen((
bool) ($body[
"fullscreen"] ?? 
false));
   137         $pc_media->getMediaObject()->update();
   140         return $this->ui_wrapper->sendPage($this->page_gui, 
$updated);
 
ilPageObjectGUI $page_gui
 
handle(array $query, array $body)
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
Server UIWrapper $ui_wrapper
 
__construct(\ilPageObjectGUI $page_gui)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
insertCommand(array $body)