ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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
 
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 32 of file class.ilDclGenericMultiInputGUI.php.

References $DIC, and ILIAS\MetaData\Repository\Validation\Data\__construct().

33  {
34  global $DIC;
35 
36  $this->ui_factory = $DIC->ui()->factory();
37  $this->renderer = $DIC->ui()->renderer();
38 
39  parent::__construct($a_title, $a_postvar);
40  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilDclGenericMultiInputGUI::checkInput ( )

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

61  : bool
62  {
63  return true;
64  }

◆ getInput()

ilDclGenericMultiInputGUI::getInput ( )

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

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

66  : array
67  {
68  return $this->strArray($this->getPostVar());
69  }
+ Here is the call graph for this function:

◆ insert()

ilDclGenericMultiInputGUI::insert ( ilTemplate  $a_tpl)

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

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

90  : void
91  {
92  $output = $this->render(0);
93 
94  if (is_array($this->line_values) && count($this->line_values) > 0) {
95  $counter = 0;
96  foreach ($this->line_values as $i => $data) {
97  $object = $this;
98  $object->setValue($data);
99  $output .= $object->render($i);
100  $counter++;
101  }
102  } else {
103  $output .= $this->render(1);
104  }
105 
106  $output = '<div id="' . $this->getFieldId() . '" class="multi_line_input">' . $output . '</div>';
107  $this->global_tpl->addJavaScript('Modules/DataCollection/js/generic_multi_line_input.js');
108  $id = $this->getFieldId();
109  $this->global_tpl->addOnLoadCode("il.DataCollection.genericMultiLineInit('$id');");
110 
111  $a_tpl->setCurrentBlock("prop_generic");
112  $a_tpl->setVariable("PROP_GENERIC", $output);
113  $a_tpl->parseCurrentBlock();
114  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
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 71 of file class.ilDclGenericMultiInputGUI.php.

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

Referenced by insert().

71  : string
72  {
73  $tpl = new ilTemplate("tpl.prop_generic_multi_line.html", true, true, 'Modules/DataCollection');
74 
75  $input = clone $this->input;
76  $input->setPostVar($this->getPostVar() . '[' . $iterator_id . ']');
77 
78  $tpl->setCurrentBlock('input');
79  $tpl->setVariable('CONTENT', $input->render());
80  $tpl->parseCurrentBlock();
81 
82  $tpl->setVariable('IMAGE_PLUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->add()));
83  $tpl->setVariable('IMAGE_MINUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->remove()));
84  $tpl->setVariable('IMAGE_UP', $this->renderer->render($this->ui_factory->symbol()->glyph()->up()));
85  $tpl->setVariable('IMAGE_DOWN', $this->renderer->render($this->ui_factory->symbol()->glyph()->down()));
86 
87  return $tpl->get();
88  }
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 42 of file class.ilDclGenericMultiInputGUI.php.

References $input.

42  : void
43  {
44  $this->input = $input;
45  }

◆ setValue()

ilDclGenericMultiInputGUI::setValue ( string  $value)

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

References IL_CAL_UNIX.

47  : void
48  {
49  if ($this->input instanceof ilDateTimeInputGUI) {
50  $this->input->setDate(new ilDateTime(strtotime($value), IL_CAL_UNIX));
51  } else {
52  $this->input->setValue($value);
53  }
54  }
const IL_CAL_UNIX
This class represents a date/time property in a property form.

◆ setValueByArray()

ilDclGenericMultiInputGUI::setValueByArray ( array  $a_values)

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

References ilFormPropertyGUI\getPostVar().

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

Field Documentation

◆ $input

ilFormPropertyGUI ilDclGenericMultiInputGUI::$input
protected

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

Referenced by render(), and setInput().

◆ $line_values

array ilDclGenericMultiInputGUI::$line_values = []
protected

Definition at line 30 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.


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