42 $this->
lng = $DIC->language();
43 $this->multi_nodes = $a_multi;
44 $this->explorer_gui = $a_explorer_gui;
45 $this->global_template = $DIC[
'tpl'];
56 return "handleExplorerCommand";
66 foreach ($val as $v) {
67 $this->explorer_gui->setNodeOpen($v);
68 $this->explorer_gui->setNodeSelected($v);
70 } elseif ($val !=
"") {
71 $this->explorer_gui->setNodeOpen($val);
72 $this->explorer_gui->setNodeSelected($val);
74 $this->explorer_gui->handleCommand();
87 if ($this->multi_nodes && !is_array($a_value)) {
88 if ($a_value !==
false) {
89 $this->value = array($a_value);
91 $this->value = array();
94 $this->value = $a_value;
124 if ((!$this->multi_nodes && trim($this->
getInput()) ===
"") ||
125 ($this->multi_nodes && count($this->
getInput()) === 0)) {
138 if ($this->multi_nodes) {
148 public function render(
string $a_mode =
"property_form"): string
152 $this->global_tpl->addJavascript(
"./Services/UIComponent/Explorer2/js/Explorer2.js");
153 $this->global_tpl->addJavascript(
"./Services/UIComponent/Modal/js/Modal.js");
154 $this->global_tpl->addOnLoadCode(
155 "il.Explorer2.initSelect('" . $this->
getFieldId() .
"');" 158 $tpl =
new ilTemplate(
"tpl.prop_expl_select.html",
true,
true,
"Services/UIComponent/Explorer2");
160 if ($a_mode !==
"property_form") {
161 $tpl->touchBlock(
"tiny_presentation");
166 if (is_array($val)) {
167 $val_txt = $sep =
"";
168 foreach ($val as $v) {
169 $tpl->setCurrentBlock(
"node_hid");
171 $tpl->setVariable(
"HID_VAL", $v);
172 $tpl->parseCurrentBlock();
175 $this->explorer_gui->setNodeOpen($v);
176 $this->explorer_gui->setNodeSelected($v);
178 $tpl->setVariable(
"VAL_TXT", $val_txt);
179 } elseif ($val !=
"") {
180 $tpl->setCurrentBlock(
"node_hid");
182 $tpl->setVariable(
"HID_VAL", $val);
183 $tpl->parseCurrentBlock();
185 $this->explorer_gui->setNodeOpen($val);
186 $this->explorer_gui->setNodeSelected($val);
191 $ol_js =
"il.Explorer2.initSelect('" . $this->
getFieldId() .
"');";
192 $this->global_template->addOnLoadCode($ol_js);
198 $tpl->setCurrentBlock(
"txt_select");
199 $tpl->setVariable(
"TXT_SELECT",
$lng->
txt(
"select"));
201 $tpl->parseCurrentBlock();
203 $tpl->setCurrentBlock(
"txt_reset");
204 $tpl->setVariable(
"TXT_RESET",
$lng->
txt(
"reset"));
206 $tpl->parseCurrentBlock();
209 $tpl->setVariable(
"EXPL", $this->explorer_gui->getHTML());
214 $button->setCaption(
"select");
215 $button->addCSSClass(
"ilExplSelectInputButS");
216 $button->setOmitPreventDoubleSubmission(
true);
217 $top_tb->addStickyItem($button);
220 $button->setCaption(
"cancel");
221 $button->addCSSClass(
"ilExplSelectInputButC");
222 $button->setOmitPreventDoubleSubmission(
true);
223 $top_tb->addStickyItem($button);
226 $tpl->setVariable(
"TOP_TB", $top_tb->getHTML());
227 $tpl->setVariable(
"BOT_TB", $top_tb->getHTML());
247 $html = $this->
render(
"table_filter");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
__construct(Container $dic, ilPlugin $plugin)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl