ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 28 of file class.ObjectSelectionListGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

39 {
40 global $DIC;
41
42 $this->ui = $DIC->ui();
43 $this->lng = $DIC->language();
44 $this->object_manager = $DIC->bookingManager()->internal()->domain()
45 ->objects($pool_id);
46 $this->form_action = $form_action;
47 $this->object_selection = $DIC->bookingManager()->internal()->domain()
48 ->objectSelection($pool_id);
49 }
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 51 of file class.ObjectSelectionListGUI.php.

51 : string
52 {
53 $tpl = new \ilTemplate("tpl.obj_selection.html", true, true, "components/ILIAS/BookingManager/BookingProcess");
54
55 $selected = $this->object_selection->getSelectedObjects();
56
57 if ($selected === []) {
58 $this->ui->mainTemplate()->setOnScreenMessage(
60 $this->lng->txt("book_week_no_objects_selected")
61 );
62 }
63
64 foreach ($this->object_manager->getObjectTitles() as $id => $title) {
65 $tpl->setCurrentBlock("item");
66 if (in_array($id, $selected)) {
67 $tpl->setVariable("CHECKED", "checked='checked'");
68 }
69 $tpl->setVariable("ID", $id);
70 $tpl->setVariable("COLOR_NR", $this->object_manager->getColorNrForObject($id));
71 $tpl->setVariable("TITLE", $title);
73 }
74
75 $tpl->setVariable("FORM_ACTION", $this->form_action);
76 $submit_button = $this->ui->factory()->button()->standard(
77 $this->lng->txt("book_refresh"),
78 "#"
79 )->withAdditionalOnLoadCode(function ($id) {
80 return <<<EOT
81 const book_submit_btn = document.getElementById('$id');
82 book_submit_btn.addEventListener("click", (event) => {
83 book_submit_btn.closest('form').submit(); return false;
84 });
85EOT;
86 });
87 $tpl->setVariable("BUTTON", $this->ui->renderer()->render($submit_button));
88
89 $p = $this->ui->factory()->panel()->secondary()->legacy(
90 $this->lng->txt("book_object_selection"),
91 $this->ui->factory()->legacy()->content($tpl->get())
92 );
93 return $this->ui->renderer()->render($p);
94 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
submit(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token,)
readonly ilGlobalTemplateInterface $tpl

References $id, ILIAS\News\Common\Table\$tpl, ILIAS\Repository\event(), ILIAS\UICore\GlobalTemplate\get(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\MESSAGE_TYPE_INFO, ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), ILIAS\BookingManager\Common\Table\submit(), 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 32 of file class.ObjectSelectionListGUI.php.

◆ $object_manager

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

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

◆ $object_selection

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

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

◆ $ui

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

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


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