ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI Class Reference
+ Collaboration diagram for ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI:

Public Member Functions

 __construct (int $pool_id, string $form_action)
 
 render ()
 

Protected Attributes

ILIAS BookingManager Objects ObjectsManager $object_manager
 
ObjectSelectionManager $object_selection
 
ilLanguage $lng
 
ILIAS DI UIServices $ui
 
string $form_action
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::__construct ( int  $pool_id,
string  $form_action 
)

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

37 {
38 global $DIC;
39
40 $this->ui = $DIC->ui();
41 $this->lng = $DIC->language();
42 $this->object_manager = $DIC->bookingManager()->internal()->domain()
43 ->objects($pool_id);
44 $this->form_action = $form_action;
45 $this->object_selection = $DIC->bookingManager()->internal()->domain()
46 ->objectSelection($pool_id);
47 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI\$form_action, ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ render()

ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::render ( )

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

49 : string
50 {
51 $tpl = new \ilTemplate("tpl.obj_selection.html", true, true, "components/ILIAS/BookingManager/BookingProcess");
52
53 $selected = $this->object_selection->getSelectedObjects();
54 foreach ($this->object_manager->getObjectTitles() as $id => $title) {
55 $tpl->setCurrentBlock("item");
56 if (in_array($id, $selected)) {
57 $tpl->setVariable("CHECKED", "checked='checked'");
58 }
59 $tpl->setVariable("ID", $id);
60 $tpl->setVariable("COLOR_NR", $this->object_manager->getColorNrForObject($id));
61 $tpl->setVariable("TITLE", $title);
62 $tpl->parseCurrentBlock();
63 }
64
65 $tpl->setVariable("FORM_ACTION", $this->form_action);
66 $submit_button = $this->ui->factory()->button()->standard(
67 $this->lng->txt("book_refresh"),
68 "#"
69 )->withAdditionalOnLoadCode(function ($id) {
70 return <<<EOT
71 const book_submit_btn = document.getElementById('$id');
72 book_submit_btn.addEventListener("click", (event) => {
73 book_submit_btn.closest('form').submit(); return false;
74 });
75EOT;
76 });
77 $tpl->setVariable("BUTTON", $this->ui->renderer()->render($submit_button));
78
79 $p = $this->ui->factory()->panel()->secondary()->legacy(
80 $this->lng->txt("book_object_selection"),
81 $this->ui->factory()->legacy()->content($tpl->get())
82 );
83 return $this->ui->renderer()->render($p);
84 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, ILIAS\Repository\event(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $form_action

string ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::$form_action
protected

◆ $lng

ilLanguage ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::$lng
protected

Definition at line 30 of file class.ObjectSelectionListGUI.php.

◆ $object_manager

ILIAS BookingManager Objects ObjectsManager ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::$object_manager
protected

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

◆ $object_selection

ObjectSelectionManager ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::$object_selection
protected

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

◆ $ui

ILIAS DI UIServices ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI::$ui
protected

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


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