ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler Class Reference
+ Inheritance diagram for ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler:
+ Collaboration diagram for ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler:

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

Definition at line 26 of file class.LayoutTemplateCommandActionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::__construct ( \ilPageObjectGUI  $page_gui)

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

35 {
36 global $DIC;
37
38 $this->ui = $DIC->ui();
39 $this->lng = $DIC->language();
40 $this->page_gui = $page_gui;
41 $this->user = $DIC->user();
42
43 $this->ui_wrapper = new Server\UIWrapper($this->ui, $this->lng);
44 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ handle()

ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::handle ( array  $query,
array  $body 
)

Definition at line 46 of file class.LayoutTemplateCommandActionHandler.php.

46 : Server\Response
47 {
48 switch ($body["action"]) {
49 case "insert":
50 return $this->insertCommand($body);
51
52 default:
53 throw new Exception("Unknown action " . $body["action"]);
54 }
55 }

References ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler\insertCommand().

+ Here is the call graph for this function:

◆ insertCommand()

ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::insertCommand ( array  $body)
protected

Definition at line 57 of file class.LayoutTemplateCommandActionHandler.php.

57 : Server\Response
58 {
59 $page = $this->page_gui->getPageObject();
60
61 $hier_id = "pg";
62 $pc_id = "";
63 if (!in_array($body["after_pcid"], ["", "pg"])) {
64 $hier_ids = $page->getHierIdsForPCIds([$body["after_pcid"]]);
65 $hier_id = $hier_ids[$body["after_pcid"]];
66 $pc_id = $body["after_pcid"];
67 }
68
69 $lay = new \ilPCLayoutTemplate($page);
70 $lay->create($page, $hier_id, $pc_id, (int) $body["tmpl"]);
71 $updated = $page->update();
72
73 return $this->ui_wrapper->sendPage($this->page_gui, $updated);
74 }

Referenced by ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler\handle().

+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::$lng
protected

Definition at line 29 of file class.LayoutTemplateCommandActionHandler.php.

◆ $page_gui

ilPageObjectGUI ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::$page_gui
protected

◆ $ui

ILIAS DI UIServices ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::$ui
protected

Definition at line 28 of file class.LayoutTemplateCommandActionHandler.php.

◆ $ui_wrapper

Server UIWrapper ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::$ui_wrapper
protected

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

◆ $user

ilObjUser ILIAS\COPage\PC\LayoutTemplate\LayoutTemplateCommandActionHandler::$user
protected

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


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