ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\COPage\PC\Tabs\TabsCommandActionHandler Class Reference
+ Inheritance diagram for ILIAS\COPage\PC\Tabs\TabsCommandActionHandler:
+ Collaboration diagram for ILIAS\COPage\PC\Tabs\TabsCommandActionHandler:

Public Member Functions

 __construct (\ilPageObjectGUI $page_gui)
 
 handle (array $query, array $body)
 

Protected Member Functions

 insertCommand (array $body)
 

Protected Attributes

ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilPageObjectGUI $page_gui
 
ilObjUser $user
 
Server UIWrapper $ui_wrapper
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file TabsCommandActionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::__construct ( \ilPageObjectGUI  $page_gui)

Definition at line 35 of file TabsCommandActionHandler.php.

References $DIC, ILIAS\COPage\PC\Tabs\TabsCommandActionHandler\$page_gui, ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

36  {
37  global $DIC;
38 
39  $this->ui = $DIC->ui();
40  $this->lng = $DIC->language();
41  $this->page_gui = $page_gui;
42  $this->user = $DIC->user();
43 
44  $this->ui_wrapper = new Server\UIWrapper($this->ui, $this->lng);
45  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ handle()

ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::handle ( array  $query,
array  $body 
)

Definition at line 47 of file TabsCommandActionHandler.php.

References ILIAS\COPage\PC\Tabs\TabsCommandActionHandler\insertCommand().

47  : Server\Response
48  {
49  switch ($body["action"]) {
50  case "insert":
51  return $this->insertCommand($body);
52 
53  case "update":
54  return $this->updateCommand($body);
55 
56  default:
57  throw new Exception("Unknown action " . $body["action"]);
58  }
59  }
+ Here is the call graph for this function:

◆ insertCommand()

ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::insertCommand ( array  $body)
protected

Definition at line 61 of file TabsCommandActionHandler.php.

References ILIAS\Repository\int(), ILIAS\Repository\lng(), and null.

Referenced by ILIAS\COPage\PC\Tabs\TabsCommandActionHandler\handle().

61  : Server\Response
62  {
63  $page = $this->page_gui->getPageObject();
64 
65  $hier_id = "pg";
66  $pc_id = "";
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"];
71  }
72 
73  // if ($form->checkInput()) {
74  $tabs = new \ilPCTabs($page);
75  $tabs->create($page, $hier_id, $pc_id);
76 
77  $type = $body["type"];
78  $tabs->setTabType($type);
79  $tabs->setTemplate("");
80  switch ($type) {
81  case \ilPCTabs::ACCORDION_VER:
82  $t = explode(":", $body["vaccord_templ"] ?? "");
83  $tabs->setTemplate($t[2] ?? "");
84  $tabs->setBehavior($body["vbehavior"]);
85  //$tabs->setHorizontalAlign($body["valign"]);
86  break;
87  case \ilPCTabs::CAROUSEL:
88  $autotime = ($body["auto_time"] != "")
89  ? (int) $body["auto_time"]
90  : null;
91  $t = explode(":", $body["carousel_templ"]);
92  $tabs->setTemplate($t[2] ?? "");
93  //$tabs->setHorizontalAlign($body["calign"]);
94  $tabs->setAutoTime($autotime);
95  $tabs->setRandomStart((bool) ($body["rand_start"] ?? false));
96  break;
97  }
98 
99  for ($i = 0; $i < (int) $body["nr"]; $i++) {
100  $tabs->addTab($this->lng->txt("cont_new_tab"));
101  }
102  $updated = $page->update();
103 
104  return $this->ui_wrapper->sendPage($this->page_gui, $updated);
105  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::$lng
protected

Definition at line 30 of file TabsCommandActionHandler.php.

◆ $page_gui

ilPageObjectGUI ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::$page_gui
protected

◆ $ui

ILIAS DI UIServices ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::$ui
protected

Definition at line 29 of file TabsCommandActionHandler.php.

◆ $ui_wrapper

Server UIWrapper ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::$ui_wrapper
protected

Definition at line 33 of file TabsCommandActionHandler.php.

◆ $user

ilObjUser ILIAS\COPage\PC\Tabs\TabsCommandActionHandler::$user
protected

Definition at line 32 of file TabsCommandActionHandler.php.


The documentation for this class was generated from the following file: