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

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 29 of file class.GridCommandActionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\PC\Grid\GridCommandActionHandler::__construct ( \ilPageObjectGUI  $page_gui)

Definition at line 37 of file class.GridCommandActionHandler.php.

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

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

Member Function Documentation

◆ handle()

ILIAS\COPage\PC\Grid\GridCommandActionHandler::handle ( array  $query,
array  $body 
)

Definition at line 49 of file class.GridCommandActionHandler.php.

References ILIAS\COPage\PC\Grid\GridCommandActionHandler\insertCommand().

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

◆ insertCommand()

ILIAS\COPage\PC\Grid\GridCommandActionHandler::insertCommand ( array  $body)
protected

Definition at line 60 of file class.GridCommandActionHandler.php.

References ILIAS\Repository\int().

Referenced by ILIAS\COPage\PC\Grid\GridCommandActionHandler\handle().

60  : Server\Response
61  {
62  $page = $this->page_gui->getPageObject();
63 
64  $hier_id = "pg";
65  $pc_id = "";
66  if (!in_array($body["after_pcid"], ["", "pg"])) {
67  $hier_ids = $page->getHierIdsForPCIds([$body["after_pcid"]]);
68  $hier_id = $hier_ids[$body["after_pcid"]];
69  $pc_id = $body["after_pcid"];
70  }
71 
72  // if ($form->checkInput()) {
73  $post_layout_template = (int) $body["layout_template"];
74  $grid = new \ilPCGrid($page);
75  $grid->create($page, $hier_id, $pc_id);
76  $grid->applyTemplate(
77  $post_layout_template,
78  (int) $body["number_of_cells"],
79  (int) $body["s"],
80  (int) $body["m"],
81  (int) $body["l"],
82  (int) $body["xl"]
83  );
84  $updated = $page->update();
85 
86  return $this->ui_wrapper->sendPage($this->page_gui, $updated);
87  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\COPage\PC\Grid\GridCommandActionHandler::$lng
protected

Definition at line 32 of file class.GridCommandActionHandler.php.

◆ $page_gui

ilPageObjectGUI ILIAS\COPage\PC\Grid\GridCommandActionHandler::$page_gui
protected

◆ $ui

ILIAS DI UIServices ILIAS\COPage\PC\Grid\GridCommandActionHandler::$ui
protected

Definition at line 31 of file class.GridCommandActionHandler.php.

◆ $ui_wrapper

Server UIWrapper ILIAS\COPage\PC\Grid\GridCommandActionHandler::$ui_wrapper
protected

Definition at line 35 of file class.GridCommandActionHandler.php.

◆ $user

ilObjUser ILIAS\COPage\PC\Grid\GridCommandActionHandler::$user
protected

Definition at line 34 of file class.GridCommandActionHandler.php.


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