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();
    44         $this->ui_wrapper = 
new Server\UIWrapper($this->
ui, $this->
lng);
    49         switch ($body[
"action"]) {
    54                 return $this->updateCommand($body);
    57                 throw new Exception(
"Unknown action " . $body[
"action"]);
    63         $page = $this->page_gui->getPageObject();
    67         if (!in_array($body[
"after_pcid"], [
"", 
"pg"])) {
    68             $hier_ids = $page->getHierIdsForPCIds([$body[
"after_pcid"]]);
    69             $hier_id = $hier_ids[$body[
"after_pcid"]];
    70             $pc_id = $body[
"after_pcid"];
    74         $tabs = new \ilPCTabs($page);
    75         $tabs->create($page, $hier_id, $pc_id);
    77         $type = $body[
"type"];
    78         $tabs->setTabType($type);
    79         $tabs->setTemplate(
"");
    81             case \ilPCTabs::ACCORDION_VER:
    82                 $t = explode(
":", $body[
"vaccord_templ"] ?? 
"");
    83                 $tabs->setTemplate($t[2] ?? 
"");
    84                 $tabs->setBehavior($body[
"vbehavior"]);
    87             case \ilPCTabs::CAROUSEL:
    88                 $autotime = ($body[
"auto_time"] != 
"")
    89                     ? (
int) $body[
"auto_time"]
    91                 $t = explode(
":", $body[
"carousel_templ"]);
    92                 $tabs->setTemplate($t[2] ?? 
"");
    94                 $tabs->setAutoTime($autotime);
    95                 $tabs->setRandomStart((
bool) ($body[
"rand_start"] ?? 
false));
    99         for ($i = 0; $i < (
int) $body[
"nr"]; $i++) {
   100             $tabs->addTab($this->
lng->txt(
"cont_new_tab"));
   102         $updated = $page->update();
   104         return $this->ui_wrapper->sendPage($this->page_gui, $updated);
   107     protected function updateCommand(array $body): Server\Response
   109         $page = $this->page_gui->getPageObject();
   112         $tabs = $page->getContentObjectForPcId($body[
"pcid"]);
   114         $type = $body[
"type"];
   115         $tabs->setTabType($type);
   116         $tabs->setTemplate(
"");
   118             case \ilPCTabs::ACCORDION_VER:
   119                 $t = explode(
":", $body[
"vaccord_templ"] ?? 
"");
   120                 $tabs->setTemplate($t[2] ?? 
"");
   121                 $tabs->setBehavior($body[
"vbehavior"]);
   124             case \ilPCTabs::CAROUSEL:
   125                 $autotime = ($body[
"auto_time"] != 
"")
   126                     ? (
int) $body[
"auto_time"]
   128                 $t = explode(
":", $body[
"carousel_templ"]);
   129                 $tabs->setTemplate($t[2] ?? 
"");
   131                 $tabs->setAutoTime($autotime);
   132                 $tabs->setRandomStart((
bool) ($body[
"rand_start"] ?? 
false));
   136         $updated = $page->update();
   138         return $this->ui_wrapper->sendPage($this->page_gui, $updated);
 
Server UIWrapper $ui_wrapper
 
insertCommand(array $body)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(\ilPageObjectGUI $page_gui)
 
ilPageObjectGUI $page_gui
 
handle(array $query, array $body)