42 $this->
lng = $DIC->language();
44 $this->main_tpl = $DIC->ui()->mainTemplate();
47 public function setId(
string $a_val): void
59 $this->link_title = $a_val;
69 $this->items = $a_val;
78 string $a_selectionheaderclass
80 $this->selectionheaderclass = $a_selectionheaderclass;
90 $this->form_cmd = $a_val;
100 $this->field_var = $a_val;
110 $this->hidden_var = $a_val;
118 public function getHTML(
bool $pull_right =
true): string
125 "tpl.checkbox_list_overlay.html",
128 "components/ILIAS/UIComponent/CheckboxListOverlay",
134 $this->main_tpl->addOnLoadCode(
" 135 const o = document.getElementById('chkbxlstovl_{$this->getId()}'); 136 o.addEventListener('click', (e) => { 140 const close = () => { 141 b.parentNode.classList.remove('open'); 142 b.area_expanded = 'false'; 143 document.removeEventListener('click', close); 145 const closeOnEscape = (e) => { 146 if (e.key === 'Escape') { 148 document.removeEventListener('keydown', closeOnEscape); 151 o.previousElementSibling.addEventListener('click', (e) => { 153 b = e.target.closest('button'); 154 if (b.parentNode.classList.contains('open')) { 158 b.parentNode.classList.add('open'); 159 b.area_expanded = 'true'; 160 document.body.click(); 161 document.addEventListener('click', close); 162 document.addEventListener('keydown', closeOnEscape); 166 $tpl->touchBlock(
"top_img");
169 $tpl->setVariable(
"TXT_SEL_TOP", $this->
getLinkTitle());
171 $tpl->parseCurrentBlock();
175 foreach ($items as $k => $v) {
176 $tpl->setCurrentBlock(
"list_entry");
178 $tpl->setVariable(
"VAL_ENTRY", $k);
179 $tpl->setVariable(
"TXT_ENTRY", $v[
"txt"]);
180 $tpl->setVariable(
"IDX_ENTRY", ++$cnt);
181 if ($v[
"selected"]) {
182 $tpl->setVariable(
"CHECKED",
"checked='checked'");
184 $tpl->parseCurrentBlock();
188 $tpl->touchBlock(
"pr");
191 $tpl->setVariable(
"ID", $this->
getId());
193 $tpl->setVariable(
"CMD_SUBMIT", $this->
getFormCmd());
194 $tpl->setVariable(
"VAL_SUBMIT", $lng->
txt(
"refresh"));
string $selectionheaderclass
ilGlobalTemplateInterface $main_tpl
getSelectionHeaderClass()
setFieldVar(string $a_val)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setSelectionHeaderClass(string $a_selectionheaderclass)
setLinkTitle(string $a_val)
getHTML(bool $pull_right=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(string $a_id="")
setFormCmd(string $a_val)
setHiddenVar(string $a_val)