19 declare(strict_types=1);
    31     protected \ilCtrlInterface 
$ctrl;
    32     protected \ILIAS\DI\UIServices 
$ui;
    33     protected \ilLanguage 
$lng;
    42         $this->
ui = $DIC->ui();
    43         $this->
lng = $DIC->language();
    44         $this->
ctrl = $DIC->ctrl();
    46         $this->
user = $DIC->user();
    47         $this->
ctrl = $DIC->ctrl();
    49         $this->ui_wrapper = 
new Server\UIWrapper($this->
ui, $this->
lng);
    54         switch ($body[
"action"]) {
    62                 throw new Exception(
"Unknown action " . $body[
"action"]);
    68         $page = $this->page_gui->getPageObject();
    72         if (!in_array($body[
"after_pcid"], [
"", 
"pg"])) {
    73             $hier_ids = $page->getHierIdsForPCIds([$body[
"after_pcid"]]);
    74             $hier_id = $hier_ids[$body[
"after_pcid"]];
    75             $pc_id = $body[
"after_pcid"];
    79         $sec = new \ilPCSection($page);
    80         $sec->create($page, $hier_id, $pc_id);
    81         $sec_gui = new \ilPCSectionGUI($page, $sec, 
"", 
"");
    82         $sec_gui->setPageConfig($page->getPageConfig());
    84         $form = $sec_gui->initForm(
true);
    88         if ($sec_gui->checkInput($form)) {
    89             $sec_gui->setValuesFromForm($form);
    92             $rendered_form = $this->
ctrl->getHTML(
    98                     "ui_wrapper" => $this->ui_wrapper,
    99                     "buttons" => [[
"Page", 
"component.save", $this->
lng->txt(
"insert")],
   100                                   [
"Page", 
"component.cancel", $this->
lng->txt(
"cancel")]]
   103             return $this->ui_wrapper->sendFormError($rendered_form);
   106         return $this->ui_wrapper->sendPage($this->page_gui, 
$updated);
   111         $page = $this->page_gui->getPageObject();
   113         $hier_id = $page->getHierIdForPcId($body[
"pcid"]);
   114         $sec = $page->getContentObjectForPcId($body[
"pcid"]);
   115         $sec_gui = new \ilPCSectionGUI($page, $sec, $hier_id, $body[
"pcid"]);
   116         $sec_gui->setStyleId($this->page_gui->getStyleId());
   117         $sec_gui->setPageConfig($page->getPageConfig());
   119         $form = $sec_gui->initForm(
false);
   123         if ($sec_gui->checkInput($form)) {
   124             $sec_gui->setValuesFromForm($form);
   127             $rendered_form = $this->
ctrl->getHTML(
   131                     "validation" => 
true,
   132                     "ui_wrapper" => $this->ui_wrapper,
   133                     "buttons" => [[
"Page", 
"component.update", $this->
lng->txt(
"save")],
   134                                   [
"Page", 
"component.cancel", $this->
lng->txt(
"cancel")]]
   137             return $this->ui_wrapper->sendFormError($rendered_form);
   140         return $this->ui_wrapper->sendPage($this->page_gui, 
$updated);
 
updateCommand(array $body)
 
ilPageObjectGUI $page_gui
 
handle(array $query, array $body)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Server UIWrapper $ui_wrapper
 
__construct(\ilPageObjectGUI $page_gui)
 
insertCommand(array $body)