ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilOrgUnitGenericMultiInputGUI Class Reference

Class ilDclGenericMultiInputGUI. 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|string $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
 symbol ()
 
 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

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\MetaData\Repository\Validation\Data\__construct(), initCSSandJS(), setMulti(), and ilFormPropertyGUI\setType().

54  {
55  parent::__construct($a_title, $a_postvar);
56  $this->setType("line_select");
57  $this->setMulti(true);
58  $this->initCSSandJS();
59  }
setMulti(bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomAttribute()

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

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

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

Referenced by render().

190  : void
191  {
192  if (isset($this->cust_attr[$key]) && !$override) {
193  $this->cust_attr[$key] .= ' ' . $value;
194  } else {
195  $this->cust_attr[$key] = $value;
196  }
197  }
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 70 of file class.ilOrgUnitGenericMultiInputGUI.php.

References ILIAS\LTI\ToolProvider\$key.

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

◆ addInput()

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

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

References ilFormPropertyGUI\getPostVar().

86  : void
87  {
88  $this->inputs[$input->getPostVar()] = $input;
89  $this->input_options[$input->getPostVar()] = $options;
90  $this->counter++;
91  }
+ 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 166 of file class.ilOrgUnitGenericMultiInputGUI.php.

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

166  : bool
167  {
168  $internal_fields = array_keys($this->inputs);
169  $key = $this->getPostVar();
170  $post = $this->raw($key);
171 
172  if (is_array($post)) {
173  foreach ($post as $authority) {
174  if (!(
175  array_key_exists(self::MULTI_FIELD_ID, $authority) &&
176  array_key_exists(self::MULTI_FIELD_OVER, $authority) &&
177  array_key_exists(self::MULTI_FIELD_SCOPE, $authority) &&
178  trim($authority[self::MULTI_FIELD_OVER]) !== '' &&
179  trim($authority[self::MULTI_FIELD_SCOPE]) !== ''
180  )) {
181  $this->setAlert($this->lng->txt("msg_input_is_required"));
182  return false;
183  }
184  }
185  }
186 
187  return true;
188  }
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 204 of file class.ilOrgUnitGenericMultiInputGUI.php.

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

Referenced by render().

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

◆ getCustomAttributes()

ilOrgUnitGenericMultiInputGUI::getCustomAttributes ( )

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

References $cust_attr.

Referenced by render().

199  : array
200  {
201  return (array) $this->cust_attr;
202  }
+ Here is the caller graph for this function:

◆ getHook()

ilOrgUnitGenericMultiInputGUI::getHook ( string  $key)

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

References ILIAS\LTI\ToolProvider\$key.

Referenced by render().

62  {
63  if (isset($this->hooks[$key])) {
64  return $this->hooks[$key];
65  }
66 
67  return false;
68  }
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 117 of file class.ilOrgUnitGenericMultiInputGUI.php.

References $inputs.

117  : array
118  {
119  return $this->inputs;
120  }

◆ getTableFilterHTML()

ilOrgUnitGenericMultiInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

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

References render().

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

◆ getTemplateDir()

ilOrgUnitGenericMultiInputGUI::getTemplateDir ( )

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

References $template_dir.

93  : string
94  {
95  return $this->template_dir;
96  }

◆ getToolbarHTML()

ilOrgUnitGenericMultiInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

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

References render().

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

◆ getValue()

ilOrgUnitGenericMultiInputGUI::getValue ( )

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

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

Referenced by render().

142  : array
143  {
144  $out = [];
145  foreach ($this->inputs as $key => $item) {
146  $out[$key] = $item->getValue();
147  }
148 
149  return $out;
150  }
$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 333 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by __construct().

334  {
335  global $tpl;
336  $tpl->addJavascript('Modules/OrgUnit/js/generic_multi_line_input.js');
337  }
+ Here is the caller graph for this function:

◆ insert()

ilOrgUnitGenericMultiInputGUI::insert ( \ilTemplate  $a_tpl)

Insert property html.

Exceptions
ilTemplateException|ilException

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

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

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

◆ isPositionMovable()

ilOrgUnitGenericMultiInputGUI::isPositionMovable ( )

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

References $position_movable.

Referenced by render().

410  : bool
411  {
413  }
+ Here is the caller graph for this function:

◆ isRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::isRenderOneForEmptyValue ( )

◆ isShowInfo()

ilOrgUnitGenericMultiInputGUI::isShowInfo ( )

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

References $show_info.

Referenced by render().

431  : bool
432  {
433  return $this->show_info;
434  }
+ Here is the caller graph for this function:

◆ isShowLabel()

ilOrgUnitGenericMultiInputGUI::isShowLabel ( )

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

References $show_label.

Referenced by render().

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

◆ isShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::isShowLabelOnce ( )

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

References $show_label_once.

Referenced by render().

420  : bool
421  {
422  return $this->show_label_once;
423  }
+ Here is the caller graph for this function:

◆ removeHook()

ilOrgUnitGenericMultiInputGUI::removeHook ( string  $key)

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

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

◆ render()

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

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

References $inputs, ILIAS\LTI\ToolProvider\$key, $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().

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

Referenced by __construct().

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

◆ setPositionMovable()

ilOrgUnitGenericMultiInputGUI::setPositionMovable ( bool  $position_movable)

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

References $position_movable.

415  : void
416  {
417  $this->position_movable = $position_movable;
418  }

◆ setRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::setRenderOneForEmptyValue ( bool  $render_one_for_empty_value)

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

References $render_one_for_empty_value.

446  : void
447  {
448  $this->render_one_for_empty_value = $render_one_for_empty_value;
449  }

◆ setShowInfo()

ilOrgUnitGenericMultiInputGUI::setShowInfo ( bool  $show_info)

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

References $show_info.

436  : void
437  {
438  $this->show_info = $show_info;
439  }

◆ setShowLabel()

ilOrgUnitGenericMultiInputGUI::setShowLabel ( bool  $show_label)

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

References $show_label.

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

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

◆ setShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::setShowLabelOnce ( bool  $show_label_once)

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

References $show_label_once, and setShowLabel().

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

◆ setTemplateDir()

ilOrgUnitGenericMultiInputGUI::setTemplateDir ( string  $template_dir)

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

References $template_dir.

99  {
100  $this->template_dir = $template_dir;
101  }

◆ setValue()

ilOrgUnitGenericMultiInputGUI::setValue ( array  $value)

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

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

Referenced by setValueByArray().

128  {
129  $this->value = $value;
130 
131  foreach ($this->inputs as $key => $item) {
132  if ($item instanceof \ilDateTimeInputGUI) {
133  $item->setDate(new \ilDate($value[$key]['date'], IL_CAL_DATE));
134  } else {
135  if (array_key_exists($key, $value)) {
136  $item->setValue((string) $value[$key]);
137  }
138  }
139  }
140  }
This class represents a date/time property in a property form.
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 152 of file class.ilOrgUnitGenericMultiInputGUI.php.

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

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

Field Documentation

◆ $counter

int ilOrgUnitGenericMultiInputGUI::$counter = 0
protected

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

◆ $cust_attr

array ilOrgUnitGenericMultiInputGUI::$cust_attr = []
protected

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

Referenced by getCustomAttributes().

◆ $hidden_inputs

array ilOrgUnitGenericMultiInputGUI::$hidden_inputs = []
protected

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

◆ $hooks

array ilOrgUnitGenericMultiInputGUI::$hooks = []
protected

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

◆ $input_options

array ilOrgUnitGenericMultiInputGUI::$input_options = []
protected

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

◆ $inputs

array ilOrgUnitGenericMultiInputGUI::$inputs = []
protected

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

Referenced by getInputs(), and render().

◆ $line_values

array ilOrgUnitGenericMultiInputGUI::$line_values = []
protected

Definition at line 42 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 44 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 50 of file class.ilOrgUnitGenericMultiInputGUI.php.

Referenced by isShowInfo(), and setShowInfo().

◆ $show_label

bool ilOrgUnitGenericMultiInputGUI::$show_label = false
protected

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

Referenced by isShowLabel(), and setShowLabel().

◆ $show_label_once

bool ilOrgUnitGenericMultiInputGUI::$show_label_once = false
protected

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

Referenced by isShowLabelOnce(), and setShowLabelOnce().

◆ $template_dir

string ilOrgUnitGenericMultiInputGUI::$template_dir = ''
protected

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

Referenced by getTemplateDir(), and setTemplateDir().

◆ $value

ilOrgUnitGenericMultiInputGUI::$value
protected

Definition at line 38 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 31 of file class.ilOrgUnitGenericMultiInputGUI.php.

◆ HOOK_IS_INPUT_DISABLED

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_INPUT_DISABLED = "hook_is_disabled"

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

◆ HOOK_IS_LINE_REMOVABLE

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"

Definition at line 29 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: