ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSelectBuilderInputGUI Class Reference

Input GUI for the configuration of select input elements. 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
 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

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
Deprecated:
12 This component will be removed with ILIAS 12

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextWizardInputGUI.

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

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

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 54 of file class.ilSelectBuilderInputGUI.php.

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

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 64 of file class.ilSelectBuilderInputGUI.php.

64 : bool
65 {
67
68 $foundvalues = $this->getInput();
69 $this->setOpenAnswerIndexes(array());
70 if (is_array($foundvalues)) {
71 foreach ($foundvalues as $value) {
72 if ($this->getRequired() && trim($value) == "") {
73 $this->setAlert($lng->txt("msg_input_is_required"));
74 return false;
75 } elseif (strlen($this->getValidationRegexp())) {
76 if (!preg_match($this->getValidationRegexp(), $value)) {
77 $this->setAlert($lng->txt("msg_wrong_format"));
78 return false;
79 }
80 }
81 }
82 } else {
83 $this->setAlert($lng->txt("msg_input_is_required"));
84 return false;
85 }
86
87 foreach ($this->strArray($this->getPostVar() . '_open') as $oindex => $ovalue) {
88 $this->addOpenAnswerIndex((string) $oindex);
89 }
90
91 return $this->checkSubItemsInput();
92 }
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 94 of file class.ilSelectBuilderInputGUI.php.

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

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 43 of file class.ilSelectBuilderInputGUI.php.

43 : array
44 {
46 }

References $open_answer_indexes.

◆ insert()

ilSelectBuilderInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextWizardInputGUI.

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

108 : void
109 {
111
112 $tpl = new ilTemplate("tpl.prop_selectbuilder.html", true, true, "components/ILIAS/Form");
113 $i = 0;
114 foreach ($this->values as $value) {
115 if (!is_string($value)) {
116 continue;
117 }
118
119 if (strlen($value)) {
120 $tpl->setCurrentBlock("prop_text_propval");
123 }
124 if ($this->getAllowMove()) {
125 $tpl->setCurrentBlock("move");
126 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
127 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
128 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
129 $tpl->setVariable("UP_BUTTON", $this->symbol()->glyph("up")->render());
130 $tpl->setVariable("DOWN_BUTTON", $this->symbol()->glyph("down")->render());
131
133 }
134 $tpl->setCurrentBlock("row");
135 $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
136 #$tpl->setVariable('POST_VAR_OPEN',$this->getPostVar().'[open]'.'['.$i.']');
137 $tpl->setVariable('POST_VAR_OPEN', $this->getPostVar() . '_open' . '[' . $i . ']');
138 $tpl->setVariable('POST_VAR_OPEN_ID', $this->getPostVar() . '_open[' . $i . ']');
139 $tpl->setVariable('TXT_OPEN', $lng->txt("form_open_answer"));
140
141 if ($this->isOpenAnswerIndex((string) $i)) {
142 $tpl->setVariable('PROP_OPEN_CHECKED', 'checked="checked"');
143 }
144 if ($this->getDisabled()) {
145 $tpl->setVariable('PROP_OPEN_DISABLED', 'disabled="disabled"');
146 }
147
148 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
149 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
150 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
151 $tpl->setVariable("SIZE", $this->getSize());
152 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
153 if ($this->getDisabled()) {
155 "DISABLED",
156 " disabled=\"disabled\""
157 );
158 }
159 $tpl->setVariable("ADD_BUTTON", $this->symbol()->glyph("add")->render());
160 $tpl->setVariable("REMOVE_BUTTON", $this->symbol()->glyph("remove")->render());
162 $i++;
163 }
164 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
165
166 $a_tpl->setCurrentBlock("prop_generic");
167 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
168 $a_tpl->parseCurrentBlock();
169
171 $tpl->addJavascript("assets/js/ServiceFormWizardInput.js");
172 $tpl->addJavascript("assets/js/textwizard.js");
173 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
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
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ilFormPropertyGUI\$lng, ilTextWizardInputGUI\$tpl, ilTextInputGUI\$value, ILIAS\UICore\GlobalTemplate\get(), ilTextWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), isOpenAnswerIndex(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTextWizardInputGUI\render(), ilTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ILIAS\UICore\GlobalTemplate\setVariable(), ilFormPropertyGUI\symbol(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ isOpenAnswerIndex()

ilSelectBuilderInputGUI::isOpenAnswerIndex ( string  $a_idx)

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

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

Referenced by insert().

+ Here is the caller graph for this function:

◆ setOpenAnswerIndexes()

ilSelectBuilderInputGUI::setOpenAnswerIndexes ( array  $a_indexes)

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

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

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilSelectBuilderInputGUI::setValueByArray ( array  $a_values)

Reimplemented from ilTextInputGUI.

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

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

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 30 of file class.ilSelectBuilderInputGUI.php.

Referenced by getOpenAnswerIndexes().


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