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