58 $this->
lng = $DIC->language();
59 $this->multi_nodes = $a_multi;
60 $this->explorer_gui = $a_explorer_gui;
61 $this->global_template = $DIC->ui()->mainTemplate();
63 $this->
ui = $DIC->ui();
74 return "handleExplorerCommand";
84 foreach ($val as $v) {
85 $this->explorer_gui->setNodeOpen($v);
86 $this->explorer_gui->setNodeSelected($v);
88 } elseif ($val !=
"") {
89 $this->explorer_gui->setNodeOpen($val);
90 $this->explorer_gui->setNodeSelected($val);
92 $this->explorer_gui->handleCommand();
105 if ($this->multi_nodes && !is_array($a_value)) {
106 if ($a_value !==
false) {
107 $this->value = array($a_value);
109 $this->value = array();
112 $this->value = $a_value;
142 if ((!$this->multi_nodes && trim($this->
getInput()) ===
"") ||
143 ($this->multi_nodes && count($this->
getInput()) === 0)) {
156 if ($this->multi_nodes) {
166 public function render(
string $a_mode =
"property_form"): string
172 $this->global_tpl->addJavascript(
"assets/js/Explorer2.js");
173 $this->global_tpl->addJavascript(
"asserts/js/LegacyModal.js");
176 $tpl =
new ilTemplate(
"tpl.prop_expl_select.html",
true,
true,
"components/ILIAS/UIComponent/Explorer2");
178 if ($a_mode !==
"property_form") {
179 $tpl->touchBlock(
"tiny_presentation");
184 if (is_array($val)) {
185 $val_txt = $sep =
"";
186 foreach ($val as $v) {
187 $tpl->setCurrentBlock(
"node_hid");
188 $tpl->setVariable(
"HID_NAME", $this->
getPostVar() .
"[]");
189 $tpl->setVariable(
"HID_VAL", $v);
190 $tpl->parseCurrentBlock();
193 $this->explorer_gui->setNodeOpen($v);
194 $this->explorer_gui->setNodeSelected($v);
196 $tpl->setVariable(
"VAL_TXT", $val_txt);
197 } elseif ($val !=
"") {
198 $tpl->setCurrentBlock(
"node_hid");
199 $tpl->setVariable(
"HID_NAME", $this->
getPostVar());
200 $tpl->setVariable(
"HID_VAL", $val);
201 $tpl->parseCurrentBlock();
203 $this->explorer_gui->setNodeOpen($val);
204 $this->explorer_gui->setNodeSelected($val);
207 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
215 $tpl->setCurrentBlock(
"txt_select");
216 $tpl->setVariable(
"TXT_SELECT",
$lng->
txt(
"select"));
217 $tpl->setVariable(
"ID_TXT_SELECT", $this->
getFieldId());
218 $tpl->parseCurrentBlock();
220 $tpl->setCurrentBlock(
"txt_reset");
221 $tpl->setVariable(
"TXT_RESET",
$lng->
txt(
"reset"));
222 $tpl->setVariable(
"ID_TXT_RESET", $this->
getFieldId());
223 $tpl->parseCurrentBlock();
226 $tpl->setVariable(
"EXPL", $this->explorer_gui->getHTML());
231 $button->setCaption(
"select");
232 $button->addCSSClass(
"ilExplSelectInputButS");
233 $button->setOmitPreventDoubleSubmission(
true);
234 $top_tb->addStickyItem($button);
237 $button->setCaption(
"cancel");
238 $button->addCSSClass(
"ilExplSelectInputButC");
239 $button->setOmitPreventDoubleSubmission(
true);
240 $top_tb->addStickyItem($button);
243 $tpl->setVariable(
"TOP_TB", $top_tb->getHTML());
244 $tpl->setVariable(
"BOT_TB", $top_tb->getHTML());
264 $html = $this->
render(
"table_filter");
270 if (isset($this->on_load_code)) {
274 $modal = $this->
ui->factory()->modal()->roundtrip(
276 $this->
ui->factory()->legacy()->content(
'<div id="' . $this->
getFieldId() .
'_expl_marker"></div>')
278 $rendered_modal = str_replace(
279 [
"\r\n",
"\n",
"\r"],
281 addslashes(json_encode($this->
ui->renderer()->renderAsync($modal)))
283 return $this->on_load_code =
'il.Explorer2.initSelect(\'' . $this->
getFieldId() .
'\',
"' . 284 $rendered_modal . '",\
'' .
285 $modal->getShowSignal() .
'\',\
'' .
286 $modal->getCloseSignal() .
'\');
'; 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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides fluid interface to RBAC services.
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)