45 $this->
lng = $DIC->language();
46 $this->multi_nodes = $a_multi;
47 $this->explorer_gui = $a_explorer_gui;
48 $this->global_template = $DIC->ui()->mainTemplate();
59 return "handleExplorerCommand";
69 foreach ($val as $v) {
70 $this->explorer_gui->setNodeOpen($v);
71 $this->explorer_gui->setNodeSelected($v);
73 } elseif ($val !=
"") {
74 $this->explorer_gui->setNodeOpen($val);
75 $this->explorer_gui->setNodeSelected($val);
77 $this->explorer_gui->handleCommand();
90 if ($this->multi_nodes && !is_array($a_value)) {
91 if ($a_value !==
false) {
92 $this->value = array($a_value);
94 $this->value = array();
97 $this->value = $a_value;
127 if ((!$this->multi_nodes && trim($this->
getInput()) ===
"") ||
128 ($this->multi_nodes && count($this->
getInput()) === 0)) {
141 if ($this->multi_nodes) {
151 public function render(
string $a_mode =
"property_form"): string
155 $this->global_tpl->addJavascript(
"./Services/UIComponent/Explorer2/js/Explorer2.js");
156 $this->global_tpl->addJavascript(
"./Services/UIComponent/Modal/js/Modal.js");
157 $this->global_tpl->addOnLoadCode(
158 "il.Explorer2.initSelect('" . $this->
getFieldId() .
"');" 161 $tpl =
new ilTemplate(
"tpl.prop_expl_select.html",
true,
true,
"Services/UIComponent/Explorer2");
163 if ($a_mode !==
"property_form") {
164 $tpl->touchBlock(
"tiny_presentation");
169 if (is_array($val)) {
170 $val_txt = $sep =
"";
171 foreach ($val as $v) {
172 $tpl->setCurrentBlock(
"node_hid");
173 $tpl->setVariable(
"HID_NAME", $this->
getPostVar() .
"[]");
174 $tpl->setVariable(
"HID_VAL", $v);
175 $tpl->parseCurrentBlock();
178 $this->explorer_gui->setNodeOpen($v);
179 $this->explorer_gui->setNodeSelected($v);
181 $tpl->setVariable(
"VAL_TXT", $val_txt);
182 } elseif ($val !=
"") {
183 $tpl->setCurrentBlock(
"node_hid");
184 $tpl->setVariable(
"HID_NAME", $this->
getPostVar());
185 $tpl->setVariable(
"HID_VAL", $val);
186 $tpl->parseCurrentBlock();
188 $this->explorer_gui->setNodeOpen($val);
189 $this->explorer_gui->setNodeSelected($val);
192 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
194 $ol_js =
"il.Explorer2.initSelect('" . $this->
getFieldId() .
"');";
195 $this->global_template->addOnLoadCode($ol_js);
201 $tpl->setCurrentBlock(
"txt_select");
202 $tpl->setVariable(
"TXT_SELECT",
$lng->
txt(
"select"));
203 $tpl->setVariable(
"ID_TXT_SELECT", $this->
getFieldId());
204 $tpl->parseCurrentBlock();
206 $tpl->setCurrentBlock(
"txt_reset");
207 $tpl->setVariable(
"TXT_RESET",
$lng->
txt(
"reset"));
208 $tpl->setVariable(
"ID_TXT_RESET", $this->
getFieldId());
209 $tpl->parseCurrentBlock();
212 $tpl->setVariable(
"EXPL", $this->explorer_gui->getHTML());
217 $button->setCaption(
"select");
218 $button->addCSSClass(
"ilExplSelectInputButS");
219 $button->setOmitPreventDoubleSubmission(
true);
220 $top_tb->addStickyItem($button);
223 $button->setCaption(
"cancel");
224 $button->addCSSClass(
"ilExplSelectInputButC");
225 $button->setOmitPreventDoubleSubmission(
true);
226 $top_tb->addStickyItem($button);
229 $tpl->setVariable(
"TOP_TB", $top_tb->getHTML());
230 $tpl->setVariable(
"BOT_TB", $top_tb->getHTML());
250 $html = $this->
render(
"table_filter");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
setVariable($variable, $value='')
Sets a variable value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)