ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilOrgUnitGenericMultiInputGUI Class Reference
+ 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...
 
 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 = []
 
int $counter = 0
 
bool $show_info = false
 
bool $render_one_for_empty_value = true
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
- 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

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
Deprecated:
This implementation MUST be replaced with a UI-components based one.

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilFormPropertyGUI.

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

59 {
60 parent::__construct($a_title, $a_postvar);
61 $this->setType("line_select");
62 $this->setMulti(true);
63 $this->initCSSandJS();
64
65 global $DIC;
66 $this->ui_factory = $DIC['ui.factory'];
67 $this->ui_renderer = $DIC['ui.renderer'];
68 }
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 194 of file class.ilOrgUnitGenericMultiInputGUI.php.

194 : void
195 {
196 if (isset($this->cust_attr[$key]) && !$override) {
197 $this->cust_attr[$key] .= ' ' . $value;
198 } else {
199 $this->cust_attr[$key] = $value;
200 }
201 }

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ addHook()

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

◆ addInput()

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

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

91 : void
92 {
93 $this->inputs[$input->getPostVar()] = $input;
94 $this->input_options[$input->getPostVar()] = $options;
95 $this->counter++;
96 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, and 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 171 of file class.ilOrgUnitGenericMultiInputGUI.php.

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

208 : string
209 {
210 if ($this->getMulti()) {
211 return $this->getPostVar() . '[' . $iterator_id . '][' . $input->getPostVar() . ']';
212 }
213 return $this->getPostVar() . '[' . $input->getPostVar() . ']';
214 }

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 203 of file class.ilOrgUnitGenericMultiInputGUI.php.

203 : array
204 {
205 return $this->cust_attr;
206 }

References $cust_attr.

Referenced by render().

+ Here is the caller graph for this function:

◆ getHook()

ilOrgUnitGenericMultiInputGUI::getHook ( string  $key)

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

71 {
72 return $this->hooks[$key] ?? false;
73 }

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 122 of file class.ilOrgUnitGenericMultiInputGUI.php.

122 : array
123 {
124 return $this->inputs;
125 }

References $inputs.

◆ getTableFilterHTML()

ilOrgUnitGenericMultiInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

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

390 : string
391 {
392 return $this->render();
393 }
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 98 of file class.ilOrgUnitGenericMultiInputGUI.php.

98 : string
99 {
100 return $this->template_dir;
101 }

References $template_dir.

◆ getToolbarHTML()

ilOrgUnitGenericMultiInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

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

398 : string
399 {
400 return $this->render("toolbar");
401 }

References render().

+ Here is the call graph for this function:

◆ getValue()

ilOrgUnitGenericMultiInputGUI::getValue ( )

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

146 : array
147 {
148 $out = [];
149 foreach ($this->inputs as $key => $item) {
150 $out[$key] = $item->getValue();
151 }
152
153 return $out;
154 }
$out
Definition: buildRTE.php:24

References $out.

Referenced by render().

+ Here is the caller graph for this function:

◆ initCSSandJS()

ilOrgUnitGenericMultiInputGUI::initCSSandJS ( )

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

326 : void
327 {
328 $this->global_tpl->addJavascript('assets/js/generic_multi_line_input.js');
329 }

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 335 of file class.ilOrgUnitGenericMultiInputGUI.php.

335 : void
336 {
337 $output = "";
338
339 $output .= $this->render(0, true);
340 if ($this->getMulti() && is_array($this->line_values) && count($this->line_values) > 0) {
341 $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/OrgUnit');
342 $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button' style='display:none'");
343 $tpl->setCurrentBlock('multi_icons');
344 $tpl->setVariable('IMAGE_PLUS', $this->getGlyph('add'));
345 $tpl->setVariable('IMAGE_MINUS', $this->getGlyph('remove'));
346 $tpl->parseCurrentBlock();
347 $output .= $tpl->get();
348 foreach ($this->line_values as $run => $data) {
349 $object = $this;
350 $object->setValue($data);
351 $output .= $object->render($run);
352 }
353 } elseif ($this->render_one_for_empty_value) {
354 $output .= $this->render(0, true);
355 } else {
356 $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/OrgUnit');
357 $tpl->setVariable('ADDITIONAL_ATTRS', "id='multi_line_add_button'");
358 $tpl->setCurrentBlock('multi_icons');
359 $tpl->setVariable('IMAGE_PLUS', $this->getGlyph('add'));
360 $tpl->setVariable('IMAGE_MINUS', $this->getGlyph('remove'));
361
362 $tpl->parseCurrentBlock();
363 $output .= $tpl->get();
364 }
365 if ($this->getMulti()) {
366 $output = "<div style=\"display:none;\" id='{$this->getFieldId()}' class='multi_line_input'>{$output}</div>";
367 $config = json_encode($this->input_options);
368 $options = json_encode([
369 'limit' => 999999,
370 'sortable' => false,
371 'locale' => $this->lng->getLangKey()
372 ]);
373 global $tpl;
374 $tpl->addOnLoadCode(
375 "
376 il.DataCollection.genericMultiLineInit('{$this->getFieldId()}',$config,$options);
377 document.body.querySelector('#{$this->getFieldId()}').removeAttribute('style');
378 "
379 );
380 }
381
382 $a_tpl->setCurrentBlock("prop_generic");
383 $a_tpl->setVariable("PROP_GENERIC", $output);
384 $a_tpl->parseCurrentBlock();
385 }
special template class to simplify handling of ITX/PEAR

References $data, ILIAS\UI\Implementation\Component\Input\Field\$options, ilFormPropertyGUI\getMulti(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ isRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::isRenderOneForEmptyValue ( )

◆ isShowInfo()

ilOrgUnitGenericMultiInputGUI::isShowInfo ( )

Definition at line 414 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 108 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 403 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 80 of file class.ilOrgUnitGenericMultiInputGUI.php.

80 : bool
81 {
82 if (isset($this->hooks[$key])) {
83 unset($this->hooks[$key]);
84
85 return true;
86 }
87
88 return false;
89 }

◆ render()

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

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

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

128 : void
129 {
130 $this->multi = $a_multi;
131 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setRenderOneForEmptyValue()

ilOrgUnitGenericMultiInputGUI::setRenderOneForEmptyValue ( bool  $render_one_for_empty_value)

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

429 : void
430 {
431 $this->render_one_for_empty_value = $render_one_for_empty_value;
432 }

References $render_one_for_empty_value.

◆ setShowInfo()

ilOrgUnitGenericMultiInputGUI::setShowInfo ( bool  $show_info)

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

419 : void
420 {
421 $this->show_info = $show_info;
422 }

References $show_info.

◆ setShowLabel()

ilOrgUnitGenericMultiInputGUI::setShowLabel ( bool  $show_label)

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

113 : void
114 {
115 $this->show_label = $show_label;
116 }

References $show_label.

Referenced by setShowLabelOnce().

+ Here is the caller graph for this function:

◆ setShowLabelOnce()

ilOrgUnitGenericMultiInputGUI::setShowLabelOnce ( bool  $show_label_once)

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

408 : void
409 {
410 $this->setShowLabel(false);
411 $this->show_label_once = $show_label_once;
412 }

References $show_label_once, and setShowLabel().

+ Here is the call graph for this function:

◆ setTemplateDir()

ilOrgUnitGenericMultiInputGUI::setTemplateDir ( string  $template_dir)

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

103 : void
104 {
105 $this->template_dir = $template_dir;
106 }

References $template_dir.

◆ setValue()

ilOrgUnitGenericMultiInputGUI::setValue ( array  $value)

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

133 : void
134 {
135 $this->value = $value;
136
137 foreach ($this->inputs as $key => $item) {
138 if ($item instanceof \ilDateTimeInputGUI) {
139 $item->setDate(new \ilDate($value[$key]['date'], IL_CAL_DATE));
140 } elseif (array_key_exists($key, $value)) {
141 $item->setValue((string) $value[$key]);
142 }
143 }
144 }
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 156 of file class.ilOrgUnitGenericMultiInputGUI.php.

156 : void
157 {
158 $data = $a_values[$this->getPostVar()] ?? [];
159 if ($this->getMulti()) {
160 $this->line_values = $data;
161 } else {
162 $this->setValue($data);
163 }
164 }

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 51 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.

◆ $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

◆ $show_info

bool ilOrgUnitGenericMultiInputGUI::$show_info = false
protected

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

◆ $ui_renderer

UIRenderer ilOrgUnitGenericMultiInputGUI::$ui_renderer
protected

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