ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilDclGenericMultiInputGUI Class Reference
+ Inheritance diagram for ilDclGenericMultiInputGUI:
+ Collaboration diagram for ilDclGenericMultiInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 setInput (ilFormPropertyGUI $input)
 
 setValue (string $value)
 
 setValueByArray (array $a_values)
 
 checkInput ()
 
 getInput ()
 
 render (int $iterator_id)
 
 insert (ilTemplate $a_tpl)
 
- 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...
 

Protected Attributes

Factory $ui_factory
 
Renderer $renderer
 
ilObjUser $user
 
ilFormPropertyGUI $input
 
array $line_values = []
 
- 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
 

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

Definition at line 24 of file class.ilDclGenericMultiInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), renderer(), and ILIAS\Repository\user().

34  {
35  global $DIC;
36 
37  $this->user = $DIC->user();
38  $this->ui_factory = $DIC->ui()->factory();
39  $this->renderer = $DIC->ui()->renderer();
40 
41  parent::__construct($a_title, $a_postvar);
42  }
renderer()
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilDclGenericMultiInputGUI::checkInput ( )

Definition at line 64 of file class.ilDclGenericMultiInputGUI.php.

64  : bool
65  {
66  return true;
67  }

◆ getInput()

ilDclGenericMultiInputGUI::getInput ( )

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

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

69  : array
70  {
71  return $this->strArray($this->getPostVar());
72  }
+ Here is the call graph for this function:

◆ insert()

ilDclGenericMultiInputGUI::insert ( ilTemplate  $a_tpl)

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

References $data, $id, ilFormPropertyGUI\getFieldId(), ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

93  : void
94  {
95  $output = $this->render(0);
96 
97  if (is_array($this->line_values) && count($this->line_values) > 0) {
98  $counter = 0;
99  foreach ($this->line_values as $i => $data) {
100  $object = $this;
101  $object->setValue($data);
102  $output .= $object->render($i);
103  $counter++;
104  }
105  } else {
106  $output .= $this->render(1);
107  }
108 
109  $output = '<div id="' . $this->getFieldId() . '" class="multi_line_input">' . $output . '</div>';
110  $this->global_tpl->addJavaScript('assets/js/generic_multi_line_input.js');
111  $id = $this->getFieldId();
112  $this->global_tpl->addOnLoadCode("il.DataCollection.genericMultiLineInit('$id');");
113 
114  $a_tpl->setCurrentBlock("prop_generic");
115  $a_tpl->setVariable("PROP_GENERIC", $output);
116  $a_tpl->parseCurrentBlock();
117  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ render()

ilDclGenericMultiInputGUI::render ( int  $iterator_id)

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

References $input, ilFormPropertyGUI\getPostVar(), renderer(), and ilFormPropertyGUI\setPostVar().

Referenced by insert().

74  : string
75  {
76  $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'components/ILIAS/DataCollection');
77 
78  $input = clone $this->input;
79  $input->setPostVar($this->getPostVar() . '[' . $iterator_id . ']');
80 
81  $tpl->setCurrentBlock('input');
82  $tpl->setVariable('CONTENT', $input->render());
83  $tpl->parseCurrentBlock();
84 
85  $tpl->setVariable('IMAGE_PLUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->add()));
86  $tpl->setVariable('IMAGE_MINUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->remove()));
87  $tpl->setVariable('IMAGE_UP', $this->renderer->render($this->ui_factory->symbol()->glyph()->up()));
88  $tpl->setVariable('IMAGE_DOWN', $this->renderer->render($this->ui_factory->symbol()->glyph()->down()));
89 
90  return $tpl->get();
91  }
renderer()
setPostVar(string $a_postvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInput()

ilDclGenericMultiInputGUI::setInput ( ilFormPropertyGUI  $input)

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

References $input.

Referenced by ilDclDateSelectionFieldRepresentation\buildOptionsInput(), ilDclTextSelectionFieldRepresentation\buildOptionsInput(), and ilDclDatetimeSelectionFieldRepresentation\buildOptionsInput().

44  : void
45  {
46  $this->input = $input;
47  }
+ Here is the caller graph for this function:

◆ setValue()

ilDclGenericMultiInputGUI::setValue ( string  $value)

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

References IL_CAL_UNIX, and ILIAS\Repository\user().

49  : void
50  {
51  if ($this->input instanceof ilDateTimeInputGUI) {
52  $date = new DateTime($value, new DateTimeZone($this->user->getTimeZone()));
53  $this->input->setDate(new ilDateTime($date->getTimestamp(), IL_CAL_UNIX));
54  } else {
55  $this->input->setValue($value);
56  }
57  }
const IL_CAL_UNIX
This class represents a date/time property in a property form.
+ Here is the call graph for this function:

◆ setValueByArray()

ilDclGenericMultiInputGUI::setValueByArray ( array  $a_values)

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

References ilFormPropertyGUI\getPostVar().

59  : void
60  {
61  $this->line_values = $a_values[$this->getPostVar()] ?? [];
62  }
+ Here is the call graph for this function:

Field Documentation

◆ $input

ilFormPropertyGUI ilDclGenericMultiInputGUI::$input
protected

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

Referenced by render(), and setInput().

◆ $line_values

array ilDclGenericMultiInputGUI::$line_values = []
protected

Definition at line 31 of file class.ilDclGenericMultiInputGUI.php.

◆ $renderer

Renderer ilDclGenericMultiInputGUI::$renderer
protected

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

◆ $ui_factory

Factory ilDclGenericMultiInputGUI::$ui_factory
protected

Definition at line 26 of file class.ilDclGenericMultiInputGUI.php.

◆ $user

ilObjUser ilDclGenericMultiInputGUI::$user
protected

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


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