ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMatrixRowWizardInputGUI 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 ilMatrixRowWizardInputGUI:
+ Collaboration diagram for ilMatrixRowWizardInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 getUseOtherAnswer ()
 
 setUseOtherAnswer (bool $a_value)
 
 setValue ($a_value)
 
 setValues (SurveyCategories $a_values)
 
 getValues ()
 
 setAllowMove (bool $a_allow_move)
 
 getAllowMove ()
 
 setShowWizard (bool $a_value)
 
 getShowWizard ()
 
 setCategoryText (string $a_text)
 
 getCategoryText ()
 
 setLabelText (string $a_text)
 
 getLabelText ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
- 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

ILIAS Survey InternalGUIService $gui
 
ilGlobalTemplateInterface $tpl
 
SurveyCategories $values = null
 
bool $allowMove = false
 
bool $show_wizard = false
 
string $categorytext
 
string $labeltext
 
bool $use_other_answer
 
- 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

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 This class represents a survey question category wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextInputGUI.

Definition at line 35 of file class.ilMatrixRowWizardInputGUI.php.

38 {
39 global $DIC;
40
41 $this->lng = $DIC->language();
42 $this->tpl = $DIC["tpl"];
43 $lng = $DIC->language();
44
45 parent::__construct($a_title, $a_postvar);
46
47 $this->show_wizard = false;
48 $this->categorytext = $lng->txt('row_text');
49 $this->use_other_answer = false;
50
51 $this->setMaxLength(1000); // #6803
52 $this->gui = $DIC->survey()->internal()->gui();
53 }
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...
setMaxLength(?int $a_maxlength)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilFormPropertyGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), ilTextInputGUI\setMaxLength(), and ilLanguage\txt().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilMatrixRowWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextInputGUI.

Definition at line 129 of file class.ilMatrixRowWizardInputGUI.php.

129 : bool
130 {
132 $foundvalues = $this->getInput();
133 if (count($foundvalues) > 0) {
134 // check answers
135 if (is_array($foundvalues['answer'])) {
136 foreach ($foundvalues['answer'] as $idx => $answervalue) {
137 if (((strlen($answervalue ?? "")) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx]))) {
138 $this->setAlert($lng->txt("msg_input_is_required"));
139 return false;
140 }
141 }
142 }
143 } else {
144 $this->setAlert($lng->txt("msg_input_is_required"));
145 return false;
146 }
147
148 return $this->checkSubItemsInput();
149 }

References ilFormPropertyGUI\$lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getInput(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getAllowMove()

ilMatrixRowWizardInputGUI::getAllowMove ( )

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

93 : bool
94 {
95 return $this->allowMove;
96 }

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

Definition at line 113 of file class.ilMatrixRowWizardInputGUI.php.

113 : string
114 {
115 return $this->categorytext;
116 }

References $categorytext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getInput()

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

Reimplemented from ilTextInputGUI.

Definition at line 151 of file class.ilMatrixRowWizardInputGUI.php.

151 : array
152 {
153 $val = $this->arrayArray($this->getPostVar());
155 return $val;
156 }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")

References ilFormPropertyGUI\arrayArray(), ilFormPropertyGUI\getPostVar(), and ilArrayUtil\stripSlashesRecursive().

Referenced by checkInput().

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

◆ getLabelText()

ilMatrixRowWizardInputGUI::getLabelText ( )

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

123 : string
124 {
125 return $this->labeltext;
126 }

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowWizard()

ilMatrixRowWizardInputGUI::getShowWizard ( )

Definition at line 103 of file class.ilMatrixRowWizardInputGUI.php.

103 : bool
104 {
105 return $this->show_wizard;
106 }

References $show_wizard.

◆ getUseOtherAnswer()

ilMatrixRowWizardInputGUI::getUseOtherAnswer ( )

Definition at line 55 of file class.ilMatrixRowWizardInputGUI.php.

References $use_other_answer.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValues()

ilMatrixRowWizardInputGUI::getValues ( )

Definition at line 83 of file class.ilMatrixRowWizardInputGUI.php.

84 {
85 return $this->values;
86 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

Definition at line 158 of file class.ilMatrixRowWizardInputGUI.php.

158 : void
159 {
161
162 $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "components/ILIAS/SurveyQuestionPool");
163 if (is_object($this->values)) {
164 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
165 $cat = $this->values->getCategory($i);
166 $tpl->setCurrentBlock("prop_text_propval");
167 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->title));
169 $tpl->setCurrentBlock("prop_label_propval");
170 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->label));
172
173 if ($this->getUseOtherAnswer()) {
174 $tpl->setCurrentBlock("other_answer_checkbox");
175 $tpl->setVariable("POST_VAR", $this->getPostVar());
176 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
177 $tpl->setVariable("ROW_NUMBER", $i);
178 if ($cat->other) {
179 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
180 }
182 }
183
184 if ($this->getAllowMove()) {
185 $tpl->setCurrentBlock("move");
186 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
187 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
188 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
189 $tpl->setVariable("UP_BUTTON", $this->gui->symbol()->glyph("up")->render());
190 $tpl->setVariable("DOWN_BUTTON", $this->gui->symbol()->glyph("down")->render());
192 }
193
194 $tpl->setCurrentBlock("row");
195 $tpl->setVariable("POST_VAR", $this->getPostVar());
196 $tpl->setVariable("ROW_NUMBER", $i);
197 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
198 $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
199 $tpl->setVariable("SIZE", $this->getSize());
200 $tpl->setVariable("SIZE_LABEL", 15);
201 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
202 if ($this->getDisabled()) {
203 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
204 $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
205 }
206
207 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
208 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
209 $tpl->setVariable("ADD_BUTTON", $this->gui->symbol()->glyph("add")->render());
210 $tpl->setVariable("REMOVE_BUTTON", $this->gui->symbol()->glyph("remove")->render());
212 }
213 }
214
215 if ($this->getUseOtherAnswer()) {
216 $tpl->setCurrentBlock('other_answer_title');
217 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
219 }
220
221 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
222 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
223 $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
224 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
225
226 $a_tpl->setCurrentBlock("prop_generic");
227 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
228 $a_tpl->parseCurrentBlock();
229
231 $tpl->addJavaScript("assets/js/ServiceFormWizardInput.js");
232 $tpl->addJavaScript("assets/js/matrixrowwizard.js");
233 }
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)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
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, $tpl, ILIAS\UICore\GlobalTemplate\addJavaScript(), ILIAS\UICore\GlobalTemplate\get(), getAllowMove(), getCategoryText(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getLabelText(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), getUseOtherAnswer(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ILIAS\UICore\GlobalTemplate\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setAllowMove()

ilMatrixRowWizardInputGUI::setAllowMove ( bool  $a_allow_move)

Definition at line 88 of file class.ilMatrixRowWizardInputGUI.php.

88 : void
89 {
90 $this->allowMove = $a_allow_move;
91 }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText ( string  $a_text)

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

108 : void
109 {
110 $this->categorytext = $a_text;
111 }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText ( string  $a_text)

Definition at line 118 of file class.ilMatrixRowWizardInputGUI.php.

118 : void
119 {
120 $this->labeltext = $a_text;
121 }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard ( bool  $a_value)

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

98 : void
99 {
100 $this->show_wizard = $a_value;
101 }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer ( bool  $a_value)

Definition at line 60 of file class.ilMatrixRowWizardInputGUI.php.

60 : void
61 {
62 $this->use_other_answer = $a_value;
63 }

◆ setValue()

ilMatrixRowWizardInputGUI::setValue (   $a_value)
Parameters
string | array$a_value

Reimplemented from ilTextInputGUI.

Definition at line 68 of file class.ilMatrixRowWizardInputGUI.php.

68 : void
69 {
70 $this->values = new SurveyCategories();
71 if (is_array($a_value) && is_array($a_value['answer'])) {
72 foreach ($a_value['answer'] as $index => $value) {
73 $this->values->addCategory($value, $a_value['other'][$index] ?? 0);
74 }
75 }
76 }

References ilTextInputGUI\$value.

◆ setValues()

ilMatrixRowWizardInputGUI::setValues ( SurveyCategories  $a_values)

Definition at line 78 of file class.ilMatrixRowWizardInputGUI.php.

78 : void
79 {
80 $this->values = $a_values;
81 }

Field Documentation

◆ $allowMove

bool ilMatrixRowWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $categorytext

string ilMatrixRowWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

◆ $gui

ILIAS Survey InternalGUIService ilMatrixRowWizardInputGUI::$gui
protected

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

◆ $labeltext

string ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

◆ $show_wizard

bool ilMatrixRowWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilGlobalTemplateInterface ilMatrixRowWizardInputGUI::$tpl
protected

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

Referenced by insert().

◆ $use_other_answer

bool ilMatrixRowWizardInputGUI::$use_other_answer
protected

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

Referenced by getUseOtherAnswer().

◆ $values

SurveyCategories ilMatrixRowWizardInputGUI::$values = null
protected

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

Referenced by getValues().


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