ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ($a_title="", $a_postvar="")
 Constructor. More...
 
 getOpenAnswerIndexes ()
 Get open answer indexes. More...
 
 setOpenAnswerIndexes ($a_indexes)
 Set open answer indexes. More...
 
 addOpenAnswerIndex ($a_idx)
 Mark an index as open answer. More...
 
 isOpenAnswerIndex ($a_idx)
 Check if an index is an open answer index. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilTextWizardInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValues ($a_values)
 Set Values. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValues ()
 Get Values. More...
 
 setAllowMove ($a_allow_move)
 Set allow move. More...
 
 getAllowMove ()
 Get allow move. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 render ($a_mode="")
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setDataSourceSubmitOnSelection ($a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl ($a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- 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...
 
- 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

 $tpl
 
 $open_answer_indexes = array()
 
- Protected Attributes inherited from ilTextWizardInputGUI
 $tpl
 
 $values = array()
 
 $allowMove = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $ajax_datasource_commit = false
 
 $ajax_datasource_commit_url
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- 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...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextWizardInputGUI.

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

25 {
26 global $DIC;
27
28 $this->lng = $DIC->language();
29 $this->tpl = $DIC["tpl"];
30 parent::__construct($a_title, $a_postvar);
31 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addOpenAnswerIndex()

ilSelectBuilderInputGUI::addOpenAnswerIndex (   $a_idx)

Mark an index as open answer.

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

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.

Returns
boolean Input ok, true/false

Reimplemented from ilTextWizardInputGUI.

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

74 {
76
77 $foundvalues = $_POST[$this->getPostVar()];
78
79
80
81 $this->setOpenAnswerIndexes(array());
82 if (is_array($foundvalues)) {
83 foreach ($foundvalues as $idx => $value) {
85 if ($this->getRequired() && trim($value) == "") {
86 $this->setAlert($lng->txt("msg_input_is_required"));
87
88 return false;
89 } elseif (strlen($this->getValidationRegexp())) {
90 if (!preg_match($this->getValidationRegexp(), $value)) {
91 $this->setAlert($lng->txt("msg_wrong_format"));
92 return false;
93 }
94 }
95 }
96 } else {
97 $this->setAlert($lng->txt("msg_input_is_required"));
98 return false;
99 }
100
101 foreach ((array) $_POST[$this->getPostVar() . '_open'] as $oindex => $ovalue) {
102 $this->addOpenAnswerIndex($oindex);
103 }
104
105
106 return $this->checkSubItemsInput();
107 }
$_POST["username"]
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
setOpenAnswerIndexes($a_indexes)
Set open answer indexes.
addOpenAnswerIndex($a_idx)
Mark an index as open answer.
getValidationRegexp()
Get validation regexp.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, ilFormPropertyGUI\$lng, ilTextInputGUI\$value, addOpenAnswerIndex(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilTextInputGUI\getValidationRegexp(), ilFormPropertyGUI\setAlert(), setOpenAnswerIndexes(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getOpenAnswerIndexes()

ilSelectBuilderInputGUI::getOpenAnswerIndexes ( )

Get open answer indexes.

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

References $open_answer_indexes.

◆ insert()

ilSelectBuilderInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextWizardInputGUI.

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

124 {
126
127 $tpl = new ilTemplate("tpl.prop_selectbuilder.html", true, true, "Services/Form");
128 $i = 0;
129 foreach ($this->values as $value) {
130 if (!is_string($value)) {
131 continue;
132 }
133
134 if (strlen((string) $value)) {
135 $tpl->setCurrentBlock("prop_text_propval");
136 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput((string) $value));
137 $tpl->parseCurrentBlock();
138 }
139 if ($this->getAllowMove()) {
140 $tpl->setCurrentBlock("move");
141 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
142 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
143 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
144 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
145 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
146 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
147
148 $tpl->parseCurrentBlock();
149 }
150 $tpl->setCurrentBlock("row");
151 $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
152 #$tpl->setVariable('POST_VAR_OPEN',$this->getPostVar().'[open]'.'['.$i.']');
153 $tpl->setVariable('POST_VAR_OPEN', $this->getPostVar() . '_open' . '[' . $i . ']');
154 $tpl->setVariable('POST_VAR_OPEN_ID', $this->getPostVar() . '_open[' . $i . ']');
155 $tpl->setVariable('TXT_OPEN', $lng->txt("form_open_answer"));
156
157 if ($this->isOpenAnswerIndex($i)) {
158 $tpl->setVariable('PROP_OPEN_CHECKED', 'checked="checked"');
159 }
160 if ($this->getDisabled()) {
161 $tpl->setVariable('PROP_OPEN_DISABLED', 'disabled="disabled"');
162 }
163
164 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
165 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
166 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
167 $tpl->setVariable("SIZE", $this->getSize());
168 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
169 if ($this->getDisabled()) {
170 $tpl->setVariable(
171 "DISABLED",
172 " disabled=\"disabled\""
173 );
174 }
175 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
176 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
177 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
178 $tpl->parseCurrentBlock();
179 $i++;
180 }
181 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
182
183 $a_tpl->setCurrentBlock("prop_generic");
184 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
185 $a_tpl->parseCurrentBlock();
186
188 $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
189 $tpl->addJavascript("./Services/Form/templates/default/textwizard.js");
190 }
getFieldId()
Get Post Variable.
static get($a_glyph, $a_text="")
Get glyph html.
isOpenAnswerIndex($a_idx)
Check if an index is an open answer index.
special template class to simplify handling of ITX/PEAR
getMaxLength()
Get Max Length.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$i
Definition: metadata.php:24

References $i, ilFormPropertyGUI\$lng, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilTextWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), isOpenAnswerIndex(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

+ Here is the call graph for this function:

◆ isOpenAnswerIndex()

ilSelectBuilderInputGUI::isOpenAnswerIndex (   $a_idx)

Check if an index is an open answer index.

Parameters
type$a_idx
Returns
type

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

64 {
65 return in_array($a_idx, (array) $this->open_answer_indexes);
66 }

Referenced by insert().

+ Here is the caller graph for this function:

◆ setOpenAnswerIndexes()

ilSelectBuilderInputGUI::setOpenAnswerIndexes (   $a_indexes)

Set open answer indexes.

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

46 {
47 $this->open_answer_indexes = $a_indexes;
48 }

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilSelectBuilderInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented from ilTextInputGUI.

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

110 {
111 parent::setValueByArray($a_values);
112
113 foreach ((array) $_POST[$this->getPostVar() . '_open'] as $oindex => $ovalue) {
114 $this->addOpenAnswerIndex($oindex);
115 }
116 }

References $_POST, addOpenAnswerIndex(), and ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

Field Documentation

◆ $open_answer_indexes

ilSelectBuilderInputGUI::$open_answer_indexes = array()
protected

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

Referenced by getOpenAnswerIndexes().

◆ $tpl

ilSelectBuilderInputGUI::$tpl
protected

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

Referenced by insert().


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