ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitGenericMultiInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilOrgUnitGenericMultiInputGUI:
+ Collaboration diagram for ilOrgUnitGenericMultiInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 getHook (string $key)
 
 addHook (string $key, array $options)
 
 removeHook (string $key)
 
 addInput (\ilFormPropertyGUI $input, array $options=[])
 
 getTemplateDir ()
 
 setTemplateDir (string $template_dir)
 
 isShowLabel ()
 
 setShowLabel (bool $show_label)
 
 getInputs ()
 Get Options. More...
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 setValue (array $value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 addCustomAttribute (string $key, string $value, bool $override=false)
 
 getCustomAttributes ()
 
 render (int $iterator_id=0, bool $clean_render=false)
 
 initCSSandJS ()
 
 insert (\ilTemplate $a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 isPositionMovable ()
 
 setPositionMovable (bool $position_movable)
 
 isShowLabelOnce ()
 
 setShowLabelOnce (bool $show_label_once)
 
 isShowInfo ()
 
 setShowInfo (bool $show_info)
 
 isRenderOneForEmptyValue ()
 
 setRenderOneForEmptyValue (bool $render_one_for_empty_value)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Data Fields

const HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"
 
const HOOK_IS_INPUT_DISABLED = "hook_is_disabled"
 
const HOOK_BEFORE_INPUT_RENDER = "hook_before_render"
 
const MULTI_FIELD_ID = "id"
 
const MULTI_FIELD_OVER = "over"
 
const MULTI_FIELD_SCOPE = "scope"
 

Protected Attributes

array $cust_attr = []
 
 $value
 
array $inputs = []
 
array $input_options = []
 
array $hooks = []
 
array $line_values = []
 
string $template_dir = ''
 
array $post_var_cache = []
 
bool $show_label = false
 
bool $show_label_once = false
 
array $hidden_inputs = []
 
bool $position_movable = false
 
int $counter = 0
 
bool $show_info = false
 
bool $render_one_for_empty_value = true
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Private Member Functions

 createInputPostVar (string $iterator_id, \ilFormPropertyGUI $input)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilDclGenericMultiInputGUI

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Theodor Truffer tt@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 25 of file class.ilOrgUnitGenericMultiInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitGenericMultiInputGUI::__construct ( string  $a_title = "",
string  $a_postvar = "" 
)

Definition at line 51 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\GlobalScreen\Provider\__construct(), initCSSandJS(), setMulti(), and ilFormPropertyGUI\setType().

52  {
53  parent::__construct($a_title, $a_postvar);
54  $this->setType("line_select");
55  $this->setMulti(true);
56  $this->initCSSandJS();
57  }
setMulti(bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomAttribute()

ilOrgUnitGenericMultiInputGUI::addCustomAttribute ( string  $key,
string  $value,
bool  $override = false 
)

Definition at line 186 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key, and $value.

Referenced by render().

186  : void
187  {
188  if (isset($this->cust_attr[$key]) && !$override) {
189  $this->cust_attr[$key] .= ' ' . $value;
190  } else {
191  $this->cust_attr[$key] = $value;
192  }
193  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ addHook()

ilOrgUnitGenericMultiInputGUI::addHook ( string  $key,
array  $options 
)

Definition at line 68 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key.

69  {
70  $this->hooks[$key] = $options;
71  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ addInput()

ilOrgUnitGenericMultiInputGUI::addInput ( \ilFormPropertyGUI  $input,
array  $options = [] 
)

Definition at line 84 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ilFormPropertyGUI\getPostVar().

84  : void
85  {
86  $this->inputs[$input->getPostVar()] = $input;
87  $this->input_options[$input->getPostVar()] = $options;
88  $this->counter++;
89  }
+ Here is the call graph for this function:

◆ checkInput()

ilOrgUnitGenericMultiInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
bool Input ok, true/false

Definition at line 164 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key, $post, ilFormPropertyGUI\getPostVar(), ILIAS\Repository\lng(), ilFormPropertyGUI\raw(), and ilFormPropertyGUI\setAlert().

164  : bool
165  {
166  $internal_fields = array_keys($this->inputs);
167  $key = $this->getPostVar();
168  $post = $this->raw($key) ?? [];
169 
170  foreach ($post as $authority) {
171  if (!(
172  array_key_exists(self::MULTI_FIELD_ID, $authority) &&
173  array_key_exists(self::MULTI_FIELD_OVER, $authority) &&
174  array_key_exists(self::MULTI_FIELD_SCOPE, $authority) &&
175  trim($authority[self::MULTI_FIELD_OVER]) !== '' &&
176  trim($authority[self::MULTI_FIELD_SCOPE]) !== ''
177  )) {
178  $this->setAlert($this->lng->txt("msg_input_is_required"));
179  return false;
180  }
181  }
182 
183  return true;
184  }
string $key
Consumer key/client ID value.
Definition: System.php:193
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:

◆ createInputPostVar()

ilOrgUnitGenericMultiInputGUI::createInputPostVar ( string  $iterator_id,
\ilFormPropertyGUI  $input 
)
private

Definition at line 200 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ilFormPropertyGUI\getMulti(), and ilFormPropertyGUI\getPostVar().

Referenced by render().

200  : string
201  {
202  if ($this->getMulti()) {
203  return $this->getPostVar() . '[' . $iterator_id . '][' . $input->getPostVar() . ']';
204  } else {
205  return $this->getPostVar() . '[' . $input->getPostVar() . ']';
206  }
207  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCustomAttributes()

ilOrgUnitGenericMultiInputGUI::getCustomAttributes ( )

Definition at line 195 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $cust_attr.

Referenced by render().

195  : array
196  {
197  return (array) $this->cust_attr;
198  }
+ Here is the caller graph for this function:

◆ getHook()

ilOrgUnitGenericMultiInputGUI::getHook ( string  $key)

Definition at line 59 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key.

Referenced by render().

60  {
61  if (isset($this->hooks[$key])) {
62  return $this->hooks[$key];
63  }
64 
65  return false;
66  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ getInputs()

ilOrgUnitGenericMultiInputGUI::getInputs ( )

Get Options.

Returns
array Options. Array ("value" => "option_text")

Definition at line 115 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $inputs.

115  : array
116  {
117  return $this->inputs;
118  }

◆ getTableFilterHTML()

ilOrgUnitGenericMultiInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Definition at line 394 of file class.ilOrgUnitGenericMultiInputGUI.php.

References render().

394  : string
395  {
396  return $this->render();
397  }
render(int $iterator_id=0, bool $clean_render=false)
+ Here is the call graph for this function:

◆ getTemplateDir()

ilOrgUnitGenericMultiInputGUI::getTemplateDir ( )

Definition at line 91 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $template_dir.

91  : string
92  {
93  return $this->template_dir;
94  }

◆ getToolbarHTML()

ilOrgUnitGenericMultiInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Definition at line 402 of file class.ilOrgUnitGenericMultiInputGUI.php.

References render().

402  : string
403  {
404  return $this->render("toolbar");
405  }
render(int $iterator_id=0, bool $clean_render=false)
+ Here is the call graph for this function:

◆ getValue()

ilOrgUnitGenericMultiInputGUI::getValue ( )

Definition at line 140 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key, and $out.

Referenced by render().

140  : array
141  {
142  $out = [];
143  foreach ($this->inputs as $key => $item) {
144  $out[$key] = $item->getValue();
145  }
146 
147  return $out;
148  }
$out
Definition: buildRTE.php:24
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ initCSSandJS()

ilOrgUnitGenericMultiInputGUI::initCSSandJS ( )

Definition at line 329 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $tpl.

Referenced by __construct().

330  {
331  global $tpl;
332  $tpl->addJavascript('Modules/OrgUnit/js/generic_multi_line_input.js');
333  }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the caller graph for this function:

◆ insert()

ilOrgUnitGenericMultiInputGUI::insert ( \ilTemplate  $a_tpl)

Insert property html.

Exceptions
ilTemplateException|ilException

Definition at line 339 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $data, $tpl, ilGlyphGUI\ADD, ilGlyphGUI\get(), ilFormPropertyGUI\getMulti(), ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

339  : void
340  {
341  $output = "";
342 
343  $output .= $this->render(0, true);
344  if ($this->getMulti() && is_array($this->line_values) && count($this->line_values) > 0) {
345 
346  $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'Modules/OrgUnit');
347  $image_plus = ilGlyphGUI::get(ilGlyphGUI::ADD);
348  $image_minus = '<span class="glyphicon glyphicon-minus hide"></span>';
349 
350  $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button' style='display:none'");
351  $tpl->setCurrentBlock('multi_icons');
352  $tpl->setVariable('IMAGE_PLUS', $image_plus);
353  $tpl->setVariable('IMAGE_MINUS', $image_minus);
354  $tpl->parseCurrentBlock();
355  $output .= $tpl->get();
356 
357  foreach ($this->line_values as $run => $data) {
358  $object = $this;
359  $object->setValue($data);
360  $output .= $object->render($run);
361  }
362  } else {
363  if ($this->render_one_for_empty_value) {
364  $output .= $this->render(0, true);
365  } else {
366  $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'Modules/OrgUnit');
367  $image_plus = ilGlyphGUI::get(ilGlyphGUI::ADD);
368  $image_minus = '<span class="glyphicon glyphicon-minus hide"></span>';
369 
370  $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button'");
371  $tpl->setCurrentBlock('multi_icons');
372  $tpl->setVariable('IMAGE_PLUS', $image_plus);
373  $tpl->setVariable('IMAGE_MINUS', $image_minus);
374  $tpl->parseCurrentBlock();
375  $output .= $tpl->get();
376  }
377  }
378  if ($this->getMulti()) {
379  $output = "<div id='{$this->getFieldId()}' class='multi_line_input'>{$output}</div>";
380 
381  global $tpl;
382  $options = json_encode($this->input_options);
383  $tpl->addOnLoadCode("$('#{$this->getFieldId()}').multi_line_input({$this->getFieldId()}, '{$options}')");
384  }
385 
386  $a_tpl->setCurrentBlock("prop_generic");
387  $a_tpl->setVariable("PROP_GENERIC", $output);
388  $a_tpl->parseCurrentBlock();
389  }
static get(string $a_glyph, string $a_text="")
render(int $iterator_id=0, bool $clean_render=false)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

◆ isPositionMovable()

ilOrgUnitGenericMultiInputGUI::isPositionMovable ( )

Definition at line 407 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $position_movable.

Referenced by render().

407  : bool
408  {
410  }
+ Here is the caller graph for this function:

◆ isRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::isRenderOneForEmptyValue ( )

◆ isShowInfo()

ilOrgUnitGenericMultiInputGUI::isShowInfo ( )

Definition at line 428 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_info.

Referenced by render().

428  : bool
429  {
430  return $this->show_info;
431  }
+ Here is the caller graph for this function:

◆ isShowLabel()

ilOrgUnitGenericMultiInputGUI::isShowLabel ( )

Definition at line 101 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_label.

Referenced by render().

101  : bool
102  {
103  return $this->show_label;
104  }
+ Here is the caller graph for this function:

◆ isShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::isShowLabelOnce ( )

Definition at line 417 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_label_once.

Referenced by render().

417  : bool
418  {
419  return $this->show_label_once;
420  }
+ Here is the caller graph for this function:

◆ removeHook()

ilOrgUnitGenericMultiInputGUI::removeHook ( string  $key)

Definition at line 73 of file class.ilOrgUnitGenericMultiInputGUI.php.

73  : bool
74  {
75  if (isset($this->hooks[$key])) {
76  unset($this->hooks[$key]);
77 
78  return true;
79  }
80 
81  return false;
82  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ render()

ilOrgUnitGenericMultiInputGUI::render ( int  $iterator_id = 0,
bool  $clean_render = false 
)

Definition at line 210 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $inputs, ILIAS\LTI\ToolProvider\$key, $tpl, $value, ilGlyphGUI\ADD, addCustomAttribute(), createInputPostVar(), ilGlyphGUI\DOWN, ilGlyphGUI\get(), getCustomAttributes(), ilFormPropertyGUI\getDisabled(), getHook(), ilFormPropertyGUI\getMulti(), getValue(), isPositionMovable(), isShowInfo(), isShowLabel(), isShowLabelOnce(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

Referenced by getTableFilterHTML(), getToolbarHTML(), and insert().

210  : string
211  {
212  $first_label = true;
213  // $tpl = new \ilTemplate("tpl.multi_line_input.html", true, true, 'Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting');
214  $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'Modules/OrgUnit');
215 
216  $class = 'multi_input_line';
217  $this->addCustomAttribute('class', $class, true);
218  foreach ($this->getCustomAttributes() as $key => $value) {
219  $tpl->setCurrentBlock('cust_attr');
220  $tpl->setVariable('CUSTOM_ATTR_KEY', $key);
221  $tpl->setVariable('CUSTOM_ATTR_VALUE', $value);
222  $tpl->parseCurrentBlock();
223  }
225  foreach ($inputs as $key => $input) {
226  $input = clone $input;
227  $is_hidden = false;
228  $is_ta = false;
229  if (!method_exists($input, 'render')) {
230  switch (true) {
231  case ($input instanceof \ilHiddenInputGUI):
232  $is_hidden = true;
233  break;
234  case ($input instanceof \ilTextAreaInputGUI):
235  $is_ta = true;
236  break;
237  default:
238  throw new \ilException("Method " . get_class($input)
239  . "::render() does not exists! You cannot use this input-type in ilMultiLineInputGUI");
240  }
241  }
242 
243  $is_disabled_hook = $this->getHook(self::HOOK_IS_INPUT_DISABLED);
244  if ($is_disabled_hook !== false && !$clean_render) {
245  $input->setDisabled($is_disabled_hook($this->getValue()));
246  }
247  if ($this->getDisabled()) {
248  $input->setDisabled(true);
249  }
250  if ($iterator_id == 0 && !isset($this->post_var_cache[$key])) {
251  $this->post_var_cache[$key] = $input->getPostVar();
252  } else {
253  // Reset post var
254  $input->setPostVar($this->post_var_cache[$key]);
255  }
256  $post_var = $this->createInputPostVar($iterator_id, $input);
257  $input->setPostVar($post_var);
258  $before_render_hook = $this->getHook(self::HOOK_BEFORE_INPUT_RENDER);
259  if ($before_render_hook !== false && !$clean_render) {
260  $input = $before_render_hook($this->getValue(), $key, $input);
261  }
262  switch (true) {
263  case $is_hidden:
264  $tpl->setCurrentBlock('hidden');
265  $tpl->setVariable('NAME', $post_var);
266  $tpl->setVariable('VALUE', ilLegacyFormElementsUtil::prepareFormOutput($input->getValue()));
267  break;
268  case $is_ta:
269  if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
270  $tpl->setCurrentBlock('input_label');
271  $tpl->setVariable('LABEL', $input->getTitle());
272  $tpl->setVariable('CONTENT', $input->getHTML());
273  $tpl->parseCurrentBlock();
274  $first_label = false;
275  } else {
276  $tpl->setCurrentBlock('input');
277  $tpl->setVariable('CONTENT', $input->getHTML());
278  }
279  break;
280  default:
281  if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
282  $tpl->setCurrentBlock('input_label');
283  $tpl->setVariable('LABEL', $input->getTitle());
284  $tpl->setVariable('CONTENT', $input->render());
285  $first_label = false;
286  } else {
287  $tpl->setCurrentBlock('input');
288  $tpl->setVariable('CONTENT', $input->render());
289  }
290  break;
291  }
292  if ($this->isShowInfo()) {
293  if ($this->isShowLabel()) {
294  $tpl->setCurrentBlock('input_info_label');
295  $tpl->setVariable('INFO_LABEL', $input->getInfo());
296  $tpl->parseCurrentBlock();
297  } else {
298  $tpl->setCurrentBlock('input_info');
299  $tpl->setVariable('INFO', $input->getInfo());
300  $tpl->parseCurrentBlock();
301  }
302  }
303  $tpl->parseCurrentBlock();
304  }
305  if ($this->getMulti() && !$this->getDisabled()) {
306  $image_plus = ilGlyphGUI::get(ilGlyphGUI::ADD);
307  $show_remove = true;
308  $is_removeable_hook = $this->getHook(self::HOOK_IS_LINE_REMOVABLE);
309  if ($is_removeable_hook !== false && !$clean_render) {
310  $show_remove = $is_removeable_hook($this->getValue());
311  }
312  $show_remove = true;
313  $image_minus = ($show_remove) ? ilGlyphGUI::get(ilGlyphGUI::REMOVE) : '<span class="glyphicon glyphicon-minus hide"></span>';
314  $tpl->setCurrentBlock('multi_icons');
315  $tpl->setVariable('IMAGE_PLUS', $image_plus);
316  $tpl->setVariable('IMAGE_MINUS', $image_minus);
317  $tpl->parseCurrentBlock();
318  if ($this->isPositionMovable()) {
319  $tpl->setCurrentBlock('multi_icons_move');
320  $tpl->setVariable('IMAGE_UP', ilGlyphGUI::get(ilGlyphGUI::UP));
321  $tpl->setVariable('IMAGE_DOWN', ilGlyphGUI::get(ilGlyphGUI::DOWN));
322  $tpl->parseCurrentBlock();
323  }
324  }
325 
326  return $tpl->get();
327  }
static get(string $a_glyph, string $a_text="")
addCustomAttribute(string $key, string $value, bool $override=false)
static prepareFormOutput($a_str, bool $a_strip=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193
createInputPostVar(string $iterator_id, \ilFormPropertyGUI $input)
This class represents a text area property in a property form.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMulti()

ilOrgUnitGenericMultiInputGUI::setMulti ( bool  $a_multi,
bool  $a_sortable = false,
bool  $a_addremove = true 
)

Definition at line 120 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by __construct().

120  : void
121  {
122  $this->multi = $a_multi;
123  }
+ Here is the caller graph for this function:

◆ setPositionMovable()

ilOrgUnitGenericMultiInputGUI::setPositionMovable ( bool  $position_movable)

Definition at line 412 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $position_movable.

412  : void
413  {
414  $this->position_movable = $position_movable;
415  }

◆ setRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::setRenderOneForEmptyValue ( bool  $render_one_for_empty_value)

Definition at line 443 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $render_one_for_empty_value.

443  : void
444  {
445  $this->render_one_for_empty_value = $render_one_for_empty_value;
446  }

◆ setShowInfo()

ilOrgUnitGenericMultiInputGUI::setShowInfo ( bool  $show_info)

Definition at line 433 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_info.

433  : void
434  {
435  $this->show_info = $show_info;
436  }

◆ setShowLabel()

ilOrgUnitGenericMultiInputGUI::setShowLabel ( bool  $show_label)

Definition at line 106 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_label.

Referenced by ilOrgUnitPositionFormGUI\initFormElements(), and setShowLabelOnce().

107  {
108  $this->show_label = $show_label;
109  }
+ Here is the caller graph for this function:

◆ setShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::setShowLabelOnce ( bool  $show_label_once)

Definition at line 422 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $show_label_once, and setShowLabel().

422  : void
423  {
424  $this->setShowLabel(false);
425  $this->show_label_once = $show_label_once;
426  }
+ Here is the call graph for this function:

◆ setTemplateDir()

ilOrgUnitGenericMultiInputGUI::setTemplateDir ( string  $template_dir)

Definition at line 96 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $template_dir.

97  {
98  $this->template_dir = $template_dir;
99  }

◆ setValue()

ilOrgUnitGenericMultiInputGUI::setValue ( array  $value)

Definition at line 125 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key, $value, and IL_CAL_DATE.

Referenced by setValueByArray().

126  {
127  $this->value = $value;
128 
129  foreach ($this->inputs as $key => $item) {
130  if ($item instanceof \ilDateTimeInputGUI) {
131  $item->setDate(new \ilDate($value[$key]['date'], IL_CAL_DATE));
132  } else {
133  if (array_key_exists($key, $value)) {
134  $item->setValue($value[$key]);
135  }
136  }
137  }
138  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ setValueByArray()

ilOrgUnitGenericMultiInputGUI::setValueByArray ( array  $a_values)

Definition at line 150 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $data, ilFormPropertyGUI\getMulti(), ilFormPropertyGUI\getPostVar(), and setValue().

150  : void
151  {
152  $data = $a_values[$this->getPostVar()] ?? [];
153  if ($this->getMulti()) {
154  $this->line_values = $data;
155  } else {
156  $this->setValue($data);
157  }
158  }
+ Here is the call graph for this function:

Field Documentation

◆ $counter

int ilOrgUnitGenericMultiInputGUI::$counter = 0
protected

Definition at line 47 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $cust_attr

array ilOrgUnitGenericMultiInputGUI::$cust_attr = []
protected

Definition at line 35 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by getCustomAttributes().

◆ $hidden_inputs

array ilOrgUnitGenericMultiInputGUI::$hidden_inputs = []
protected

Definition at line 45 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $hooks

array ilOrgUnitGenericMultiInputGUI::$hooks = []
protected

Definition at line 39 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $input_options

array ilOrgUnitGenericMultiInputGUI::$input_options = []
protected

Definition at line 38 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $inputs

array ilOrgUnitGenericMultiInputGUI::$inputs = []
protected

Definition at line 37 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by getInputs(), and render().

◆ $line_values

array ilOrgUnitGenericMultiInputGUI::$line_values = []
protected

Definition at line 40 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $position_movable

bool ilOrgUnitGenericMultiInputGUI::$position_movable = false
protected

◆ $post_var_cache

array ilOrgUnitGenericMultiInputGUI::$post_var_cache = []
protected

Definition at line 42 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ $render_one_for_empty_value

bool ilOrgUnitGenericMultiInputGUI::$render_one_for_empty_value = true
protected

◆ $show_info

bool ilOrgUnitGenericMultiInputGUI::$show_info = false
protected

Definition at line 48 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by isShowInfo(), and setShowInfo().

◆ $show_label

bool ilOrgUnitGenericMultiInputGUI::$show_label = false
protected

Definition at line 43 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by isShowLabel(), and setShowLabel().

◆ $show_label_once

bool ilOrgUnitGenericMultiInputGUI::$show_label_once = false
protected

Definition at line 44 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by isShowLabelOnce(), and setShowLabelOnce().

◆ $template_dir

string ilOrgUnitGenericMultiInputGUI::$template_dir = ''
protected

Definition at line 41 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by getTemplateDir(), and setTemplateDir().

◆ $value

ilOrgUnitGenericMultiInputGUI::$value
protected

Definition at line 36 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by addCustomAttribute(), render(), and setValue().

◆ HOOK_BEFORE_INPUT_RENDER

const ilOrgUnitGenericMultiInputGUI::HOOK_BEFORE_INPUT_RENDER = "hook_before_render"

Definition at line 29 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ HOOK_IS_INPUT_DISABLED

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_INPUT_DISABLED = "hook_is_disabled"

Definition at line 28 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ HOOK_IS_LINE_REMOVABLE

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"

Definition at line 27 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ MULTI_FIELD_ID

const ilOrgUnitGenericMultiInputGUI::MULTI_FIELD_ID = "id"

◆ MULTI_FIELD_OVER

const ilOrgUnitGenericMultiInputGUI::MULTI_FIELD_OVER = "over"

◆ MULTI_FIELD_SCOPE

const ilOrgUnitGenericMultiInputGUI::MULTI_FIELD_SCOPE = "scope"

The documentation for this class was generated from the following file: