ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
UIRendererLoader $renderer_loader
 
- 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)
 
 getGlyph (string $which)
 

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 = "" 
)

Reimplemented from ilFormPropertyGUI.

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

61 {
62 parent::__construct($a_title, $a_postvar);
63 $this->setType("line_select");
64 $this->setMulti(true);
65 $this->initCSSandJS();
66
67 global $DIC;
68 $this->ui_factory = $DIC['ui.factory'];
69 $this->ui_renderer = $DIC['ui.renderer'];
70 $this->renderer_loader = $DIC["ui.component_renderer_loader"];
71
72 }
setMulti(bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomAttribute()

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

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

203 : void
204 {
205 if (isset($this->cust_attr[$key]) && !$override) {
206 $this->cust_attr[$key] .= ' ' . $value;
207 } else {
208 $this->cust_attr[$key] = $value;
209 }
210 }

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ addHook()

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

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

84 {
85 $this->hooks[$key] = $options;
86 }

◆ addInput()

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

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

99 : void
100 {
101 $this->inputs[$input->getPostVar()] = $input;
102 $this->input_options[$input->getPostVar()] = $options;
103 $this->counter++;
104 }

References ilFormPropertyGUI\getPostVar().

+ 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

Reimplemented from ilFormPropertyGUI.

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

179 : bool
180 {
181 $internal_fields = array_keys($this->inputs);
182 $key = $this->getPostVar();
183 $post = $this->raw($key);
184
185 if (is_array($post)) {
186 foreach ($post as $authority) {
187 if (!(
188 array_key_exists(self::MULTI_FIELD_ID, $authority) &&
189 array_key_exists(self::MULTI_FIELD_OVER, $authority) &&
190 array_key_exists(self::MULTI_FIELD_SCOPE, $authority) &&
191 trim($authority[self::MULTI_FIELD_OVER]) !== '' &&
192 trim($authority[self::MULTI_FIELD_SCOPE]) !== ''
193 )) {
194 $this->setAlert($this->lng->txt("msg_input_is_required"));
195 return false;
196 }
197 }
198 }
199
200 return true;
201 }
$post
Definition: ltitoken.php:46

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

+ Here is the call graph for this function:

◆ createInputPostVar()

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

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

217 : string
218 {
219 if ($this->getMulti()) {
220 return $this->getPostVar() . '[' . $iterator_id . '][' . $input->getPostVar() . ']';
221 } else {
222 return $this->getPostVar() . '[' . $input->getPostVar() . ']';
223 }
224 }

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

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCustomAttributes()

ilOrgUnitGenericMultiInputGUI::getCustomAttributes ( )

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

212 : array
213 {
214 return (array) $this->cust_attr;
215 }

References $cust_attr.

Referenced by render().

+ Here is the caller graph for this function:

◆ getGlyph()

ilOrgUnitGenericMultiInputGUI::getGlyph ( string  $which)
private

do not render an a-tag around the glyph. should be outdated and removed when Glyphs loose their Clickable

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

461 : string
462 {
463 $symbol = $this->ui_factory->symbol()->glyph()->$which();
468 $renderer = $this->renderer_loader->getRendererFor(
469 $symbol,
470 [$this->ui_factory->button()->bulky($symbol, '', '')]
471 );
472 return $renderer->render($symbol, $this->ui_renderer);
473 }
$renderer

References $renderer.

Referenced by insert(), and render().

+ Here is the caller graph for this function:

◆ getHook()

ilOrgUnitGenericMultiInputGUI::getHook ( string  $key)

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

75 {
76 if (isset($this->hooks[$key])) {
77 return $this->hooks[$key];
78 }
79
80 return false;
81 }

Referenced by render().

+ Here is the caller graph for this function:

◆ getInputs()

ilOrgUnitGenericMultiInputGUI::getInputs ( )

Get Options.

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

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

130 : array
131 {
132 return $this->inputs;
133 }

References $inputs.

◆ getTableFilterHTML()

ilOrgUnitGenericMultiInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

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

407 : string
408 {
409 return $this->render();
410 }
render(int|string $iterator_id=0, bool $clean_render=false)

References render().

+ Here is the call graph for this function:

◆ getTemplateDir()

ilOrgUnitGenericMultiInputGUI::getTemplateDir ( )

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

106 : string
107 {
108 return $this->template_dir;
109 }

References $template_dir.

◆ getToolbarHTML()

ilOrgUnitGenericMultiInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

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

415 : string
416 {
417 return $this->render("toolbar");
418 }

References render().

+ Here is the call graph for this function:

◆ getValue()

ilOrgUnitGenericMultiInputGUI::getValue ( )

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

155 : array
156 {
157 $out = [];
158 foreach ($this->inputs as $key => $item) {
159 $out[$key] = $item->getValue();
160 }
161
162 return $out;
163 }
$out
Definition: buildRTE.php:24

References $out.

Referenced by render().

+ Here is the caller graph for this function:

◆ initCSSandJS()

ilOrgUnitGenericMultiInputGUI::initCSSandJS ( )

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

343 {
344 $this->global_tpl->addJavascript('assets/js/generic_multi_line_input.js');
345 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ insert()

ilOrgUnitGenericMultiInputGUI::insert ( \ilTemplate  $a_tpl)

Insert property html.

Exceptions
ilTemplateException|ilException

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

351 : void
352 {
353 $output = "";
354
355 $output .= $this->render(0, true);
356 if ($this->getMulti() && is_array($this->line_values) && count($this->line_values) > 0) {
357 $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/OrgUnit');
358 $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button' style='display:none'");
359 $tpl->setCurrentBlock('multi_icons');
360 $tpl->setVariable('IMAGE_PLUS', $this->getGlyph('add'));
361 $tpl->setVariable('IMAGE_MINUS', $this->getGlyph('remove'));
362 $tpl->parseCurrentBlock();
363 $output .= $tpl->get();
364
365 foreach ($this->line_values as $run => $data) {
366 $object = $this;
367 $object->setValue($data);
368 $output .= $object->render($run);
369 }
370 } else {
371 if ($this->render_one_for_empty_value) {
372 $output .= $this->render(0, true);
373 } else {
374 $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/OrgUnit');
375 $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button'");
376 $tpl->setCurrentBlock('multi_icons');
377 $tpl->setVariable('IMAGE_PLUS', $this->getGlyph('add'));
378 $tpl->setVariable('IMAGE_MINUS', $this->getGlyph('remove'));
379
380 $tpl->parseCurrentBlock();
381 $output .= $tpl->get();
382 }
383 }
384 if ($this->getMulti()) {
385 $output = "<div style=\"display:none;\" id='{$this->getFieldId()}' class='multi_line_input'>{$output}</div>";
386 $config = json_encode($this->input_options);
387 $options = json_encode([
388 'limit' => 999999,
389 'sortable' => false,
390 'locale' => $this->lng->getLangKey()
391 ]);
392 global $tpl;
393 $tpl->addOnLoadCode("
394 il.DataCollection.genericMultiLineInit('{$this->getFieldId()}',$config,$options);
395 document.body.querySelector('#{$this->getFieldId()}').removeAttribute('style');
396 ");
397 }
398
399 $a_tpl->setCurrentBlock("prop_generic");
400 $a_tpl->setVariable("PROP_GENERIC", $output);
401 $a_tpl->parseCurrentBlock();
402 }
special template class to simplify handling of ITX/PEAR

References $data, getGlyph(), ilFormPropertyGUI\getMulti(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ isPositionMovable()

ilOrgUnitGenericMultiInputGUI::isPositionMovable ( )

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

References $position_movable.

Referenced by render().

+ Here is the caller graph for this function:

◆ isRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::isRenderOneForEmptyValue ( )

◆ isShowInfo()

ilOrgUnitGenericMultiInputGUI::isShowInfo ( )

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

References $show_info.

Referenced by render().

+ Here is the caller graph for this function:

◆ isShowLabel()

ilOrgUnitGenericMultiInputGUI::isShowLabel ( )

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

References $show_label.

Referenced by render().

+ Here is the caller graph for this function:

◆ isShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::isShowLabelOnce ( )

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

References $show_label_once.

Referenced by render().

+ Here is the caller graph for this function:

◆ removeHook()

ilOrgUnitGenericMultiInputGUI::removeHook ( string  $key)

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

88 : bool
89 {
90 if (isset($this->hooks[$key])) {
91 unset($this->hooks[$key]);
92
93 return true;
94 }
95
96 return false;
97 }

◆ render()

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

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

227 : string
228 {
229 $first_label = true;
230 $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/OrgUnit');
231
232 $class = 'multi_input_line';
233 $this->addCustomAttribute('class', $class, true);
234 foreach ($this->getCustomAttributes() as $key => $value) {
235 $tpl->setCurrentBlock('cust_attr');
236 $tpl->setVariable('CUSTOM_ATTR_KEY', $key);
237 $tpl->setVariable('CUSTOM_ATTR_VALUE', $value);
238 $tpl->parseCurrentBlock();
239 }
241 foreach ($inputs as $key => $input) {
242 $input = clone $input;
243 $is_hidden = false;
244 $is_ta = false;
245 if (!method_exists($input, 'render')) {
246 switch (true) {
247 case ($input instanceof \ilHiddenInputGUI):
248 $is_hidden = true;
249 break;
250 case ($input instanceof \ilTextAreaInputGUI):
251 $is_ta = true;
252 break;
253 default:
254 throw new \ilException("Method " . get_class($input)
255 . "::render() does not exists! You cannot use this input-type in ilMultiLineInputGUI");
256 }
257 }
258
259 $is_disabled_hook = $this->getHook(self::HOOK_IS_INPUT_DISABLED);
260 if ($is_disabled_hook !== false && !$clean_render) {
261 $input->setDisabled($is_disabled_hook($this->getValue()));
262 }
263 if ($this->getDisabled()) {
264 $input->setDisabled(true);
265 }
266 if ($iterator_id == 0 && !isset($this->post_var_cache[$key])) {
267 $this->post_var_cache[$key] = $input->getPostVar();
268 } else {
269 // Reset post var
270 $input->setPostVar($this->post_var_cache[$key]);
271 }
272 $post_var = $this->createInputPostVar((string) $iterator_id, $input);
273 $input->setPostVar($post_var);
274 $before_render_hook = $this->getHook(self::HOOK_BEFORE_INPUT_RENDER);
275 if ($before_render_hook !== false && !$clean_render) {
276 $input = $before_render_hook($this->getValue(), $key, $input);
277 }
278 switch (true) {
279 case $is_hidden:
280 $tpl->setCurrentBlock('hidden');
281 $tpl->setVariable('NAME', $post_var);
282 $tpl->setVariable('VALUE', ilLegacyFormElementsUtil::prepareFormOutput($input->getValue()));
283 break;
284 case $is_ta:
285 if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
286 $tpl->setCurrentBlock('input_label');
287 $tpl->setVariable('LABEL', $input->getTitle());
288 $tpl->setVariable('CONTENT', $input->getHTML());
289 $tpl->parseCurrentBlock();
290 $first_label = false;
291 } else {
292 $tpl->setCurrentBlock('input');
293 $tpl->setVariable('CONTENT', $input->getHTML());
294 }
295 break;
296 default:
297 if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
298 $tpl->setCurrentBlock('input_label');
299 $tpl->setVariable('LABEL', $input->getTitle());
300 $tpl->setVariable('CONTENT', $input->render());
301 $first_label = false;
302 } else {
303 $tpl->setCurrentBlock('input');
304 $tpl->setVariable('CONTENT', $input->render());
305 }
306 break;
307 }
308 if ($this->isShowInfo()) {
309 if ($this->isShowLabel()) {
310 $tpl->setCurrentBlock('input_info_label');
311 $tpl->setVariable('INFO_LABEL', $input->getInfo());
312 $tpl->parseCurrentBlock();
313 } else {
314 $tpl->setCurrentBlock('input_info');
315 $tpl->setVariable('INFO', $input->getInfo());
316 $tpl->parseCurrentBlock();
317 }
318 }
319 $tpl->parseCurrentBlock();
320 }
321 if ($this->getMulti() && !$this->getDisabled()) {
322 $is_removeable_hook = $this->getHook(self::HOOK_IS_LINE_REMOVABLE);
323 if ($is_removeable_hook !== false && !$clean_render) {
324 $show_remove = $is_removeable_hook($this->getValue());
325 }
326 $tpl->setCurrentBlock('multi_icons');
327 $tpl->setVariable('IMAGE_PLUS', $this->getGlyph('add'));
328 $tpl->setVariable('IMAGE_MINUS', $this->getGlyph('remove'));
329 $tpl->parseCurrentBlock();
330
331 if ($this->isPositionMovable()) {
332 $tpl->setCurrentBlock('multi_icons_move');
333 $tpl->setVariable('IMAGE_UP', $this->getGlyph('up'));
334 $tpl->setVariable('IMAGE_DOWN', $this->getGlyph('down'));
335 $tpl->parseCurrentBlock();
336 }
337 }
338
339 return $tpl->get();
340 }
This class represents a hidden form property in a property form.
static prepareFormOutput($a_str, bool $a_strip=false)
addCustomAttribute(string $key, string $value, bool $override=false)
createInputPostVar(string $iterator_id, \ilFormPropertyGUI $input)
This class represents a text area property in a property form.

References $inputs, $value, addCustomAttribute(), createInputPostVar(), getCustomAttributes(), ilFormPropertyGUI\getDisabled(), getGlyph(), getHook(), ilFormPropertyGUI\getMulti(), getValue(), isPositionMovable(), isShowInfo(), isShowLabel(), isShowLabelOnce(), and ilLegacyFormElementsUtil\prepareFormOutput().

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

+ 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 
)

Reimplemented from ilFormPropertyGUI.

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

135 : void
136 {
137 $this->multi = $a_multi;
138 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPositionMovable()

ilOrgUnitGenericMultiInputGUI::setPositionMovable ( bool  $position_movable)

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

425 : void
426 {
427 $this->position_movable = $position_movable;
428 }

References $position_movable.

◆ setRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::setRenderOneForEmptyValue ( bool  $render_one_for_empty_value)

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

456 : void
457 {
458 $this->render_one_for_empty_value = $render_one_for_empty_value;
459 }

References $render_one_for_empty_value.

◆ setShowInfo()

ilOrgUnitGenericMultiInputGUI::setShowInfo ( bool  $show_info)

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

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

References $show_info.

◆ setShowLabel()

ilOrgUnitGenericMultiInputGUI::setShowLabel ( bool  $show_label)

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

122 {
123 $this->show_label = $show_label;
124 }

References $show_label.

Referenced by setShowLabelOnce().

+ Here is the caller graph for this function:

◆ setShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::setShowLabelOnce ( bool  $show_label_once)

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

435 : void
436 {
437 $this->setShowLabel(false);
438 $this->show_label_once = $show_label_once;
439 }

References $show_label_once, and setShowLabel().

+ Here is the call graph for this function:

◆ setTemplateDir()

ilOrgUnitGenericMultiInputGUI::setTemplateDir ( string  $template_dir)

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

112 {
113 $this->template_dir = $template_dir;
114 }

References $template_dir.

◆ setValue()

ilOrgUnitGenericMultiInputGUI::setValue ( array  $value)

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

141 {
142 $this->value = $value;
143
144 foreach ($this->inputs as $key => $item) {
145 if ($item instanceof \ilDateTimeInputGUI) {
146 $item->setDate(new \ilDate($value[$key]['date'], IL_CAL_DATE));
147 } else {
148 if (array_key_exists($key, $value)) {
149 $item->setValue((string) $value[$key]);
150 }
151 }
152 }
153 }
const IL_CAL_DATE
This class represents a date/time property in a property form.
Class for single dates.

References $value, and IL_CAL_DATE.

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilOrgUnitGenericMultiInputGUI::setValueByArray ( array  $a_values)

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

165 : void
166 {
167 $data = $a_values[$this->getPostVar()] ?? [];
168 if ($this->getMulti()) {
169 $this->line_values = $data;
170 } else {
171 $this->setValue($data);
172 }
173 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $counter

int ilOrgUnitGenericMultiInputGUI::$counter = 0
protected

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

◆ $cust_attr

array ilOrgUnitGenericMultiInputGUI::$cust_attr = []
protected

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

Referenced by getCustomAttributes().

◆ $hidden_inputs

array ilOrgUnitGenericMultiInputGUI::$hidden_inputs = []
protected

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

◆ $hooks

array ilOrgUnitGenericMultiInputGUI::$hooks = []
protected

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

◆ $input_options

array ilOrgUnitGenericMultiInputGUI::$input_options = []
protected

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

◆ $inputs

array ilOrgUnitGenericMultiInputGUI::$inputs = []
protected

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

Referenced by getInputs(), and render().

◆ $line_values

array ilOrgUnitGenericMultiInputGUI::$line_values = []
protected

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

◆ $render_one_for_empty_value

bool ilOrgUnitGenericMultiInputGUI::$render_one_for_empty_value = true
protected

◆ $renderer_loader

UIRendererLoader ilOrgUnitGenericMultiInputGUI::$renderer_loader
protected

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

◆ $show_info

bool ilOrgUnitGenericMultiInputGUI::$show_info = false
protected

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

Referenced by isShowInfo(), and setShowInfo().

◆ $show_label

bool ilOrgUnitGenericMultiInputGUI::$show_label = false
protected

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

Referenced by isShowLabel(), and setShowLabel().

◆ $show_label_once

bool ilOrgUnitGenericMultiInputGUI::$show_label_once = false
protected

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

Referenced by isShowLabelOnce(), and setShowLabelOnce().

◆ $template_dir

string ilOrgUnitGenericMultiInputGUI::$template_dir = ''
protected

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

Referenced by getTemplateDir(), and setTemplateDir().

◆ $ui_factory

UIFactory ilOrgUnitGenericMultiInputGUI::$ui_factory
protected

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

◆ $ui_renderer

UIRenderer ilOrgUnitGenericMultiInputGUI::$ui_renderer
protected

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

◆ $value

ilOrgUnitGenericMultiInputGUI::$value
protected

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

◆ HOOK_IS_INPUT_DISABLED

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_INPUT_DISABLED = "hook_is_disabled"

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

◆ HOOK_IS_LINE_REMOVABLE

const ilOrgUnitGenericMultiInputGUI::HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"

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