ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilOrgUnitMultiLineInputGUI Class Reference

Class ilOrgUnitMultiLineInputGUI. More...

+ Inheritance diagram for ilOrgUnitMultiLineInputGUI:
+ Collaboration diagram for ilOrgUnitMultiLineInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 getHook ($key)
 
 addHook ($key, $options)
 
 removeHook ($key)
 
 addInput (\ilFormPropertyGUI $input, $options=array())
 
 getTemplateDir ()
 
 setTemplateDir ($template_dir)
 
 isShowLabel ()
 
 setShowLabel ($show_label)
 
 getInputs ()
 Get Options. More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 addCustomAttribute ($key, $value, $override=false)
 
 getCustomAttributes ()
 
 render ($iterator_id=0, $clean_render=false)
 Render item. More...
 
 initCSSandJS ()
 
 insert (&$a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 isPositionMovable ()
 
 setPositionMovable ($position_movable)
 
 isShowLabelOnce ()
 
 setShowLabelOnce ($show_label_once)
 
 isShowInfo ()
 
 setShowInfo ($show_info)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 

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"
 

Protected Member Functions

 createInputPostVar ($iterator_id, \ilFormPropertyGUI $input)
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $cust_attr = array()
 
 $value
 
 $inputs = array()
 
 $input_options = array()
 
 $hooks = array()
 
 $line_values = array()
 
 $template_dir = ''
 
 $post_var_cache = array()
 
 $show_label = false
 
 $show_label_once = false
 
 $hidden_inputs = array()
 
 $position_movable = false
 
 $counter = 0
 
 $show_info = false
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitMultiLineInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 78 of file class.ilOrgUnitMultiLineInputGUI.php.

References initCSSandJS(), setMulti(), and ilFormPropertyGUI\setType().

79  {
80  parent::__construct($a_title, $a_postvar);
81  $this->setType("line_select");
82  $this->setMulti(true);
83  $this->initCSSandJS();
84  }
setType($a_type)
Set Type.
setMulti($a_multi, $a_sortable=false, $a_addremove=true)
+ Here is the call graph for this function:

Member Function Documentation

◆ addCustomAttribute()

ilOrgUnitMultiLineInputGUI::addCustomAttribute (   $key,
  $value,
  $override = false 
)
Parameters
$key
$value
bool | false$override

Definition at line 287 of file class.ilOrgUnitMultiLineInputGUI.php.

References $key, and $value.

Referenced by render().

288  {
289  if (isset($this->cust_attr[$key]) && !$override) {
290  $this->cust_attr[$key] .= ' ' . $value;
291  } else {
292  $this->cust_attr[$key] = $value;
293  }
294  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ addHook()

ilOrgUnitMultiLineInputGUI::addHook (   $key,
  $options 
)
Parameters
array$options

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

References $key, and PHPMailer\PHPMailer\$options.

104  {
105  $this->hooks[$key] = $options;
106  }
$key
Definition: croninfo.php:18

◆ addInput()

ilOrgUnitMultiLineInputGUI::addInput ( \ilFormPropertyGUI  $input,
  $options = array() 
)
Parameters
$input
array$options

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

References $input, PHPMailer\PHPMailer\$options, and ilFormPropertyGUI\getPostVar().

131  {
132  $this->inputs[$input->getPostVar()] = $input;
133  $this->input_options[$input->getPostVar()] = $options;
134  $this->counter++;
135  }
+ Here is the call graph for this function:

◆ checkInput()

ilOrgUnitMultiLineInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 249 of file class.ilOrgUnitMultiLineInputGUI.php.

References $_POST, $inputs, ilFormPropertyGUI\$lng, $valid, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

250  {
251  global $lng;
252  $valid = true;
253  // escape data
254  $out_array = array();
255  foreach ($_POST[$this->getPostVar()] as $item_num => $item) {
256  foreach ($this->inputs as $input_key => $input) {
257  if (isset($item[$input_key])) {
258  $out_array[$item_num][$input_key] = (is_string($item[$input_key])) ? \ilUtil::stripSlashes($item[$input_key]) : $item[$input_key];
259  }
260  }
261  }
262  $_POST[$this->getPostVar()] = $out_array;
263  if ($this->getRequired() && !trim(implode("", $_POST[$this->getPostVar()]))) {
264  $valid = false;
265  }
266  // validate
267  foreach ($this->inputs as $input_key => $inputs) {
268  if (!$inputs->checkInput()) {
269  $valid = false;
270  }
271  }
272  if (!$valid) {
273  $this->setAlert($lng->txt("msg_input_is_required"));
274 
275  return false;
276  }
277 
278  return $valid;
279  }
getPostVar()
Get Post Variable.
$valid
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ createInputPostVar()

ilOrgUnitMultiLineInputGUI::createInputPostVar (   $iterator_id,
\ilFormPropertyGUI  $input 
)
protected
Parameters
$iterator_id
\ilFormPropertyGUI$input
Returns
string

Definition at line 312 of file class.ilOrgUnitMultiLineInputGUI.php.

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

Referenced by render().

313  {
314  if ($this->getMulti()) {
315  return $this->getPostVar() . '[' . $iterator_id . '][' . $input->getPostVar() . ']';
316  } else {
317  return $this->getPostVar() . '[' . $input->getPostVar() . ']';
318  }
319  }
getPostVar()
Get Post Variable.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCustomAttributes()

ilOrgUnitMultiLineInputGUI::getCustomAttributes ( )
Returns
array

Definition at line 300 of file class.ilOrgUnitMultiLineInputGUI.php.

References $cust_attr.

Referenced by render().

301  {
302  return (array) $this->cust_attr;
303  }
+ Here is the caller graph for this function:

◆ getHook()

ilOrgUnitMultiLineInputGUI::getHook (   $key)
Returns
string

Definition at line 90 of file class.ilOrgUnitMultiLineInputGUI.php.

References $key.

Referenced by render().

91  {
92  if (isset($this->hooks[$key])) {
93  return $this->hooks[$key];
94  }
95 
96  return false;
97  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ getInputs()

ilOrgUnitMultiLineInputGUI::getInputs ( )

Get Options.

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

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

References $inputs.

◆ getTableFilterHTML()

ilOrgUnitMultiLineInputGUI::getTableFilterHTML ( )

Get HTML for table filter.

Definition at line 489 of file class.ilOrgUnitMultiLineInputGUI.php.

References $html, and render().

490  {
491  $html = $this->render();
492 
493  return $html;
494  }
render($iterator_id=0, $clean_render=false)
Render item.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getTemplateDir()

ilOrgUnitMultiLineInputGUI::getTemplateDir ( )
Returns
mixed

Definition at line 141 of file class.ilOrgUnitMultiLineInputGUI.php.

References $template_dir.

◆ getToolbarHTML()

ilOrgUnitMultiLineInputGUI::getToolbarHTML ( )

Get HTML for toolbar.

Definition at line 500 of file class.ilOrgUnitMultiLineInputGUI.php.

References $html, and render().

501  {
502  $html = $this->render("toolbar");
503 
504  return $html;
505  }
render($iterator_id=0, $clean_render=false)
Render item.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getValue()

ilOrgUnitMultiLineInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $key, and $out.

Referenced by render().

218  {
219  $out = array();
220  foreach ($this->inputs as $key => $item) {
221  $out[$key] = $item->getValue();
222  }
223 
224  return $out;
225  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ initCSSandJS()

ilOrgUnitMultiLineInputGUI::initCSSandJS ( )

Definition at line 448 of file class.ilOrgUnitMultiLineInputGUI.php.

References $tpl.

Referenced by __construct().

449  {
450  global $tpl;
451  $tpl->addJavascript('./Modules/OrgUnit/templates/default/multi_line_input.js');
452  }
$tpl
Definition: ilias.php:10
+ Here is the caller graph for this function:

◆ insert()

ilOrgUnitMultiLineInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 460 of file class.ilOrgUnitMultiLineInputGUI.php.

References $data, Sabre\VObject\$output, ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getMulti(), and render().

461  {
462  $output = "";
463 
464  $output .= $this->render(0, true);
465  if ($this->getMulti() && is_array($this->line_values) && count($this->line_values) > 0) {
466  foreach ($this->line_values as $run => $data) {
467  $object = $this;
468  $object->setValue($data);
469  $output .= $object->render($run);
470  }
471  } else {
472  $output .= $this->render(0, true);
473  }
474  if ($this->getMulti()) {
475  $output = '<div id="' . $this->getFieldId() . '" class="multi_line_input">' . $output
476  . '</div>';
477  $output .= '<script type="text/javascript">$("#' . $this->getFieldId()
478  . '").multi_line_input(' . json_encode($this->input_options) . ')</script>';
479  }
480  $a_tpl->setCurrentBlock("prop_generic");
481  $a_tpl->setVariable("PROP_GENERIC", $output);
482  $a_tpl->parseCurrentBlock();
483  }
getFieldId()
Get Post Variable.
render($iterator_id=0, $clean_render=false)
Render item.
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ isPositionMovable()

ilOrgUnitMultiLineInputGUI::isPositionMovable ( )
Returns
boolean

Definition at line 511 of file class.ilOrgUnitMultiLineInputGUI.php.

References $position_movable.

Referenced by render().

+ Here is the caller graph for this function:

◆ isShowInfo()

ilOrgUnitMultiLineInputGUI::isShowInfo ( )
Returns
boolean

Definition at line 548 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_info.

Referenced by render().

+ Here is the caller graph for this function:

◆ isShowLabel()

ilOrgUnitMultiLineInputGUI::isShowLabel ( )
Returns
boolean

Definition at line 159 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_label.

Referenced by render().

+ Here is the caller graph for this function:

◆ isShowLabelOnce()

ilOrgUnitMultiLineInputGUI::isShowLabelOnce ( )
Returns
boolean

Definition at line 529 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_label_once.

Referenced by render().

+ Here is the caller graph for this function:

◆ removeHook()

ilOrgUnitMultiLineInputGUI::removeHook (   $key)
Parameters
$key
Returns
bool

Definition at line 114 of file class.ilOrgUnitMultiLineInputGUI.php.

References $key.

115  {
116  if (isset($this->hooks[$key])) {
117  unset($this->hooks[$key]);
118 
119  return true;
120  }
121 
122  return false;
123  }
$key
Definition: croninfo.php:18

◆ render()

ilOrgUnitMultiLineInputGUI::render (   $iterator_id = 0,
  $clean_render = false 
)

Render item.

Parameters
int$iterator_id
Returns
string
Exceptions

Definition at line 330 of file class.ilOrgUnitMultiLineInputGUI.php.

References $input, $inputs, $key, $tpl, $value, addCustomAttribute(), createInputPostVar(), ILIAS\GlobalScreen\get(), getCustomAttributes(), ilFormPropertyGUI\getDisabled(), getHook(), ilFormPropertyGUI\getMulti(), getValue(), isPositionMovable(), isShowInfo(), isShowLabel(), isShowLabelOnce(), and ilUtil\prepareFormOutput().

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

331  {
332  $first_label = true;
333  $tpl = new \ilTemplate("tpl.multi_line_input.html", true, true, 'Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting');
334  $class = 'multi_input_line';
335  $this->addCustomAttribute('class', $class, true);
336  foreach ($this->getCustomAttributes() as $key => $value) {
337  $tpl->setCurrentBlock('cust_attr');
338  $tpl->setVariable('CUSTOM_ATTR_KEY', $key);
339  $tpl->setVariable('CUSTOM_ATTR_VALUE', $value);
340  $tpl->parseCurrentBlock();
341  }
343  foreach ($inputs as $key => $input) {
344  $input = clone $input;
345  $is_hidden = false;
346  $is_ta = false;
347  if (!method_exists($input, 'render')) {
348  switch (true) {
349  case ($input instanceof \ilHiddenInputGUI):
350  $is_hidden = true;
351  break;
352  case ($input instanceof \ilTextAreaInputGUI):
353  $is_ta = true;
354  break;
355  default:
356  throw new \ilException("Method " . get_class($input)
357  . "::render() does not exists! You cannot use this input-type in ilMultiLineInputGUI");
358  }
359  }
360 
361  $is_disabled_hook = $this->getHook(self::HOOK_IS_INPUT_DISABLED);
362  if ($is_disabled_hook !== false && !$clean_render) {
363  $input->setDisabled($is_disabled_hook($this->getValue()));
364  }
365  if ($this->getDisabled()) {
366  $input->setDisabled(true);
367  }
368  if ($iterator_id == 0 && !isset($this->post_var_cache[$key])) {
369  $this->post_var_cache[$key] = $input->getPostVar();
370  } else {
371  // Reset post var
372  $input->setPostVar($this->post_var_cache[$key]);
373  }
374  $post_var = $this->createInputPostVar($iterator_id, $input);
375  $input->setPostVar($post_var);
376  $before_render_hook = $this->getHook(self::HOOK_BEFORE_INPUT_RENDER);
377  if ($before_render_hook !== false && !$clean_render) {
378  $input = $before_render_hook($this->getValue(), $key, $input);
379  }
380  switch (true) {
381  case $is_hidden:
382  $tpl->setCurrentBlock('hidden');
383  $tpl->setVariable('NAME', $post_var);
384  $tpl->setVariable('VALUE', \ilUtil::prepareFormOutput($input->getValue()));
385  break;
386  case $is_ta:
387  if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
388  $tpl->setCurrentBlock('input_label');
389  $tpl->setVariable('LABEL', $input->getTitle());
390  $tpl->setVariable('CONTENT', $input->getHTML());
391  $tpl->parseCurrentBlock();
392  $first_label = false;
393  } else {
394  $tpl->setCurrentBlock('input');
395  $tpl->setVariable('CONTENT', $input->getHTML());
396  }
397  break;
398  default:
399  if ($this->isShowLabel() || ($this->isShowLabelOnce() && $first_label)) {
400  $tpl->setCurrentBlock('input_label');
401  $tpl->setVariable('LABEL', $input->getTitle());
402  $tpl->setVariable('CONTENT', $input->render());
403  $first_label = false;
404  } else {
405  $tpl->setCurrentBlock('input');
406  $tpl->setVariable('CONTENT', $input->render());
407  }
408  break;
409  }
410  if ($this->isShowInfo()) {
411  if ($this->isShowLabel()) {
412  $tpl->setCurrentBlock('input_info_label');
413  $tpl->setVariable('INFO_LABEL', $input->getInfo());
414  $tpl->parseCurrentBlock();
415  } else {
416  $tpl->setCurrentBlock('input_info');
417  $tpl->setVariable('INFO', $input->getInfo());
418  $tpl->parseCurrentBlock();
419  }
420  }
421  $tpl->parseCurrentBlock();
422  }
423  if ($this->getMulti() && !$this->getDisabled()) {
424  $image_plus = xlvoGlyphGUI::get('plus');
425  $show_remove = true;
426  $is_removeable_hook = $this->getHook(self::HOOK_IS_LINE_REMOVABLE);
427  if ($is_removeable_hook !== false && !$clean_render) {
428  $show_remove = $is_removeable_hook($this->getValue());
429  }
430  $show_remove = true;
431  $image_minus = ($show_remove) ? xlvoGlyphGUI::get('minus') : '<span class="glyphicon glyphicon-minus hide"></span>';
432  $tpl->setCurrentBlock('multi_icons');
433  $tpl->setVariable('IMAGE_PLUS', $image_plus);
434  $tpl->setVariable('IMAGE_MINUS', $image_minus);
435  $tpl->parseCurrentBlock();
436  if ($this->isPositionMovable()) {
437  $tpl->setCurrentBlock('multi_icons_move');
438  $tpl->setVariable('IMAGE_UP', xlvoGlyphGUI::get(xlvoGlyphGUI::UP));
439  $tpl->setVariable('IMAGE_DOWN', xlvoGlyphGUI::get(xlvoGlyphGUI::DOWN));
440  $tpl->parseCurrentBlock();
441  }
442  }
443 
444  return $tpl->get();
445  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
createInputPostVar($iterator_id, \ilFormPropertyGUI $input)
$tpl
Definition: ilias.php:10
This class represents a hidden form property in a property form.
get(string $class_name)
addCustomAttribute($key, $value, $override=false)
This class represents a text area property in a property form.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMulti()

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

Definition at line 188 of file class.ilOrgUnitMultiLineInputGUI.php.

Referenced by __construct().

189  {
190  $this->multi = $a_multi;
191  }
+ Here is the caller graph for this function:

◆ setPositionMovable()

ilOrgUnitMultiLineInputGUI::setPositionMovable (   $position_movable)
Parameters
boolean$position_movable

Definition at line 520 of file class.ilOrgUnitMultiLineInputGUI.php.

References $position_movable.

521  {
522  $this->position_movable = $position_movable;
523  }

◆ setShowInfo()

ilOrgUnitMultiLineInputGUI::setShowInfo (   $show_info)
Parameters
boolean$show_info

Definition at line 557 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_info.

558  {
559  $this->show_info = $show_info;
560  }

◆ setShowLabel()

ilOrgUnitMultiLineInputGUI::setShowLabel (   $show_label)
Parameters
boolean$show_label

Definition at line 168 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_label.

Referenced by setShowLabelOnce().

169  {
170  $this->show_label = $show_label;
171  }
+ Here is the caller graph for this function:

◆ setShowLabelOnce()

ilOrgUnitMultiLineInputGUI::setShowLabelOnce (   $show_label_once)
Parameters
boolean$show_label_once

Definition at line 538 of file class.ilOrgUnitMultiLineInputGUI.php.

References $show_label_once, and setShowLabel().

539  {
540  $this->setShowLabel(false);
541  $this->show_label_once = $show_label_once;
542  }
+ Here is the call graph for this function:

◆ setTemplateDir()

ilOrgUnitMultiLineInputGUI::setTemplateDir (   $template_dir)
Parameters
mixed$template_dir

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

References $template_dir.

151  {
152  $this->template_dir = $template_dir;
153  }

◆ setValue()

ilOrgUnitMultiLineInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

References $key, and IL_CAL_DATE.

Referenced by setValueByArray().

200  {
201  foreach ($this->inputs as $key => $item) {
202  if (method_exists($item, 'setValue')) {
203  $item->setValue($a_value[$key]);
204  } elseif ($item instanceof \ilDateTimeInputGUI) {
205  $item->setDate(new \ilDate($a_value[$key]['date'], IL_CAL_DATE));
206  }
207  }
208  $this->value = $a_value;
209  }
This class represents a date/time property in a property form.
Class for single dates.
const IL_CAL_DATE
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ setValueByArray()

ilOrgUnitMultiLineInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 233 of file class.ilOrgUnitMultiLineInputGUI.php.

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

234  {
235  $data = $a_values[$this->getPostVar()];
236  if ($this->getMulti()) {
237  $this->line_values = $data;
238  } else {
239  $this->setValue($data);
240  }
241  }
getPostVar()
Get Post Variable.
$data
Definition: bench.php:6
+ Here is the call graph for this function:

Field Documentation

◆ $counter

ilOrgUnitMultiLineInputGUI::$counter = 0
protected

Definition at line 65 of file class.ilOrgUnitMultiLineInputGUI.php.

◆ $cust_attr

ilOrgUnitMultiLineInputGUI::$cust_attr = array()
protected

Definition at line 17 of file class.ilOrgUnitMultiLineInputGUI.php.

Referenced by getCustomAttributes().

◆ $hidden_inputs

ilOrgUnitMultiLineInputGUI::$hidden_inputs = array()
protected

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

◆ $hooks

ilOrgUnitMultiLineInputGUI::$hooks = array()
protected

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

◆ $input_options

ilOrgUnitMultiLineInputGUI::$input_options = array()
protected

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

◆ $inputs

ilOrgUnitMultiLineInputGUI::$inputs = array()
protected

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

Referenced by checkInput(), getInputs(), and render().

◆ $line_values

ilOrgUnitMultiLineInputGUI::$line_values = array()
protected

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

◆ $position_movable

ilOrgUnitMultiLineInputGUI::$position_movable = false
protected

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

Referenced by isPositionMovable(), and setPositionMovable().

◆ $post_var_cache

ilOrgUnitMultiLineInputGUI::$post_var_cache = array()
protected

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

◆ $show_info

ilOrgUnitMultiLineInputGUI::$show_info = false
protected

Definition at line 69 of file class.ilOrgUnitMultiLineInputGUI.php.

Referenced by isShowInfo(), and setShowInfo().

◆ $show_label

ilOrgUnitMultiLineInputGUI::$show_label = false
protected

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

Referenced by isShowLabel(), and setShowLabel().

◆ $show_label_once

ilOrgUnitMultiLineInputGUI::$show_label_once = false
protected

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

Referenced by isShowLabelOnce(), and setShowLabelOnce().

◆ $template_dir

ilOrgUnitMultiLineInputGUI::$template_dir = ''
protected

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

Referenced by getTemplateDir(), and setTemplateDir().

◆ $value

ilOrgUnitMultiLineInputGUI::$value
protected

Definition at line 21 of file class.ilOrgUnitMultiLineInputGUI.php.

Referenced by addCustomAttribute(), and render().

◆ HOOK_BEFORE_INPUT_RENDER

const ilOrgUnitMultiLineInputGUI::HOOK_BEFORE_INPUT_RENDER = "hook_before_render"

Definition at line 13 of file class.ilOrgUnitMultiLineInputGUI.php.

◆ HOOK_IS_INPUT_DISABLED

const ilOrgUnitMultiLineInputGUI::HOOK_IS_INPUT_DISABLED = "hook_is_disabled"

Definition at line 12 of file class.ilOrgUnitMultiLineInputGUI.php.

◆ HOOK_IS_LINE_REMOVABLE

const ilOrgUnitMultiLineInputGUI::HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"

Definition at line 11 of file class.ilOrgUnitMultiLineInputGUI.php.


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