ILIAS  release_8 Revision v8.24
ilSelectBuilderInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSelectBuilderInputGUI:
+ Collaboration diagram for ilSelectBuilderInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 getOpenAnswerIndexes ()
 
 setOpenAnswerIndexes (array $a_indexes)
 
 addOpenAnswerIndex (string $a_idx)
 
 isOpenAnswerIndex (string $a_idx)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 setValueByArray (array $a_values)
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilTextWizardInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValues (array $a_values)
 
 setValue ($a_value)
 
 getValues ()
 
 setAllowMove (bool $a_allow_move)
 
 getAllowMove ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 render (string $a_mode="")
 
- Public Member Functions inherited from ilTextInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValue ($a_value)
 
 getValue ()
 
 setValidationFailureMessage (string $a_msg)
 
 getValidationFailureMessage ()
 
 setValidationRegexp (string $a_value)
 
 getValidationRegexp ()
 
 setMaxLength (?int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setInlineStyle (string $a_style)
 
 getInlineStyle ()
 
 setCssClass (string $a_class)
 
 getCssClass ()
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setSuffix (string $a_value)
 
 getSuffix ()
 
 setInputType (string $a_type)
 set input type More...
 
 getInputType ()
 
 setSubmitFormOnEnter (bool $a_val)
 
 getSubmitFormOnEnter ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getDataSource ()
 
 setDataSource (string $href, string $a_delimiter=null)
 
 setDataSourceSubmitOnSelection (bool $a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl (string $a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 setDisableHtmlAutoComplete (bool $autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
 getPostValueForComparison ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
- 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...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Attributes

array $open_answer_indexes = array()
 
- Protected Attributes inherited from ilTextWizardInputGUI
ilGlobalTemplateInterface $tpl
 
array $values = array()
 
bool $allowMove = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- 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
 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Input GUI for the configuration of select input elements. E.g course custum field, udf field, ...

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextWizardInputGUI.

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

34 {
35 global $DIC;
36
37 $this->lng = $DIC->language();
38 $this->tpl = $DIC["tpl"];
39 parent::__construct($a_title, $a_postvar);
40 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addOpenAnswerIndex()

ilSelectBuilderInputGUI::addOpenAnswerIndex ( string  $a_idx)

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

53 : void
54 {
55 $this->open_answer_indexes[] = $a_idx;
56 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ checkInput()

ilSelectBuilderInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextWizardInputGUI.

Definition at line 63 of file class.ilSelectBuilderInputGUI.php.

63 : bool
64 {
66
67 $foundvalues = $this->getInput();
68 $this->setOpenAnswerIndexes(array());
69 if (is_array($foundvalues)) {
70 foreach ($foundvalues as $value) {
71 if ($this->getRequired() && trim($value) == "") {
72 $this->setAlert($lng->txt("msg_input_is_required"));
73 return false;
74 } elseif (strlen($this->getValidationRegexp())) {
75 if (!preg_match($this->getValidationRegexp(), $value)) {
76 $this->setAlert($lng->txt("msg_wrong_format"));
77 return false;
78 }
79 }
80 }
81 } else {
82 $this->setAlert($lng->txt("msg_input_is_required"));
83 return false;
84 }
85
86 foreach ($this->strArray($this->getPostVar() . '_open') as $oindex => $ovalue) {
87 $this->addOpenAnswerIndex((string) $oindex);
88 }
89
90 return $this->checkSubItemsInput();
91 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References ilFormPropertyGUI\$lng, ilTextInputGUI\$value, addOpenAnswerIndex(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilTextInputGUI\getValidationRegexp(), ilFormPropertyGUI\setAlert(), setOpenAnswerIndexes(), ilFormPropertyGUI\strArray(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getInput()

ilSelectBuilderInputGUI::getInput ( )
Returns
string|string[]

Reimplemented from ilTextWizardInputGUI.

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

93 : array
94 {
95 return $this->strArray($this->getPostVar());
96 }

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

Referenced by checkInput().

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

◆ getOpenAnswerIndexes()

ilSelectBuilderInputGUI::getOpenAnswerIndexes ( )

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

42 : array
43 {
45 }

References $open_answer_indexes.

◆ insert()

ilSelectBuilderInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextWizardInputGUI.

Definition at line 107 of file class.ilSelectBuilderInputGUI.php.

107 : void
108 {
110
111 $tpl = new ilTemplate("tpl.prop_selectbuilder.html", true, true, "Services/Form");
112 $i = 0;
113 foreach ($this->values as $value) {
114 if (!is_string($value)) {
115 continue;
116 }
117
118 if (strlen($value)) {
119 $tpl->setCurrentBlock("prop_text_propval");
122 }
123 if ($this->getAllowMove()) {
124 $tpl->setCurrentBlock("move");
125 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
126 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
127 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
130
132 }
133 $tpl->setCurrentBlock("row");
134 $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
135 #$tpl->setVariable('POST_VAR_OPEN',$this->getPostVar().'[open]'.'['.$i.']');
136 $tpl->setVariable('POST_VAR_OPEN', $this->getPostVar() . '_open' . '[' . $i . ']');
137 $tpl->setVariable('POST_VAR_OPEN_ID', $this->getPostVar() . '_open[' . $i . ']');
138 $tpl->setVariable('TXT_OPEN', $lng->txt("form_open_answer"));
139
140 if ($this->isOpenAnswerIndex((string) $i)) {
141 $tpl->setVariable('PROP_OPEN_CHECKED', 'checked="checked"');
142 }
143 if ($this->getDisabled()) {
144 $tpl->setVariable('PROP_OPEN_DISABLED', 'disabled="disabled"');
145 }
146
147 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
148 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
149 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
150 $tpl->setVariable("SIZE", $this->getSize());
151 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
152 if ($this->getDisabled()) {
154 "DISABLED",
155 " disabled=\"disabled\""
156 );
157 }
161 $i++;
162 }
163 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
164
165 $a_tpl->setCurrentBlock("prop_generic");
166 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
167 $a_tpl->parseCurrentBlock();
168
170 $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
171 $tpl->addJavascript("./Services/Form/templates/default/textwizard.js");
172 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static get(string $a_glyph, string $a_text="")
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
$i
Definition: metadata.php:41

References $i, ilFormPropertyGUI\$lng, ilTextWizardInputGUI\$tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilGlobalTemplateInterface\get(), ilTextWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), isOpenAnswerIndex(), ilGlobalTemplateInterface\parseCurrentBlock(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, ilTemplate\setCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), HTML_Template_IT\setVariable(), ilGlobalTemplateInterface\setVariable(), ilLanguage\txt(), and ilGlyphGUI\UP.

+ Here is the call graph for this function:

◆ isOpenAnswerIndex()

ilSelectBuilderInputGUI::isOpenAnswerIndex ( string  $a_idx)

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

58 : bool
59 {
60 return in_array($a_idx, $this->open_answer_indexes);
61 }

Referenced by insert().

+ Here is the caller graph for this function:

◆ setOpenAnswerIndexes()

ilSelectBuilderInputGUI::setOpenAnswerIndexes ( array  $a_indexes)

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

47 : void
48 {
49 $this->open_answer_indexes = $a_indexes;
50 }

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilSelectBuilderInputGUI::setValueByArray ( array  $a_values)

Reimplemented from ilTextInputGUI.

Definition at line 98 of file class.ilSelectBuilderInputGUI.php.

98 : void
99 {
100 parent::setValueByArray($a_values);
101
102 foreach ($this->strArray($this->getPostVar() . '_open') as $oindex => $ovalue) {
103 $this->addOpenAnswerIndex((string) $oindex);
104 }
105 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $open_answer_indexes

array ilSelectBuilderInputGUI::$open_answer_indexes = array()
protected

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

Referenced by getOpenAnswerIndexes().


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