ILIAS  release_8 Revision v8.24
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 ()
 
 setShowSavePhrase (bool $a_value)
 
 getShowSavePhrase ()
 
 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

ilGlobalTemplateInterface $tpl
 
SurveyCategories $values = null
 
bool $allowMove = false
 
bool $show_wizard = false
 
bool $show_save_phrase = 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
 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->show_save_phrase = false;
49 $this->categorytext = $lng->txt('row_text');
50 $this->use_other_answer = false;
51
52 $this->setMaxLength(1000); // #6803
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)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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 138 of file class.ilMatrixRowWizardInputGUI.php.

138 : bool
139 {
141 $foundvalues = $this->getInput();
142 if (count($foundvalues) > 0) {
143 // check answers
144 if (is_array($foundvalues['answer'])) {
145 foreach ($foundvalues['answer'] as $idx => $answervalue) {
146 if (((strlen($answervalue)) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx]))) {
147 $this->setAlert($lng->txt("msg_input_is_required"));
148 return false;
149 }
150 }
151 }
152 } else {
153 $this->setAlert($lng->txt("msg_input_is_required"));
154 return false;
155 }
156
157 return $this->checkSubItemsInput();
158 }

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 160 of file class.ilMatrixRowWizardInputGUI.php.

160 : array
161 {
162 $val = $this->arrayArray($this->getPostVar());
164 return $val;
165 }
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:

◆ getShowSavePhrase()

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

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

133 : bool
134 {
136 }

References $show_save_phrase.

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.

Referenced by insert().

+ Here is the caller graph for this function:

◆ 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 167 of file class.ilMatrixRowWizardInputGUI.php.

167 : void
168 {
170
171 $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool");
172 if (is_object($this->values)) {
173 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
174 $cat = $this->values->getCategory($i);
175 $tpl->setCurrentBlock("prop_text_propval");
176 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->title));
178 $tpl->setCurrentBlock("prop_label_propval");
179 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->label));
181
182 if ($this->getUseOtherAnswer()) {
183 $tpl->setCurrentBlock("other_answer_checkbox");
184 $tpl->setVariable("POST_VAR", $this->getPostVar());
185 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
186 $tpl->setVariable("ROW_NUMBER", $i);
187 if ($cat->other) {
188 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
189 }
191 }
192
193 if ($this->getAllowMove()) {
194 $tpl->setCurrentBlock("move");
195 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
196 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
197 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
201 }
202
203 $tpl->setCurrentBlock("row");
204 $tpl->setVariable("POST_VAR", $this->getPostVar());
205 $tpl->setVariable("ROW_NUMBER", $i);
206 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
207 $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
208 $tpl->setVariable("SIZE", $this->getSize());
209 $tpl->setVariable("SIZE_LABEL", 15);
210 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
211 if ($this->getDisabled()) {
212 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
213 $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
214 }
215
216 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
217 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
221 }
222 }
223
224 if ($this->getShowWizard()) {
225 $tpl->setCurrentBlock("wizard");
226 $tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']');
227 $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.svg'));
228 $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
230 }
231
232 if ($this->getShowSavePhrase()) {
233 $tpl->setCurrentBlock('savephrase');
234 $tpl->setVariable("POST_VAR", $this->getPostVar());
235 $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
237 }
238
239 if ($this->getUseOtherAnswer()) {
240 $tpl->setCurrentBlock('other_answer_title');
241 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
243 }
244
245 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
246 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
247 $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
248 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
249
250 $a_tpl->setCurrentBlock("prop_generic");
251 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
252 $a_tpl->parseCurrentBlock();
253
255 $tpl->addJavaScript("./Services/Form/js/ServiceFormWizardInput.js");
256 $tpl->addJavaScript("./Modules/SurveyQuestionPool/js/matrixrowwizard.js");
257 }
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)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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.
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, $tpl, ilGlyphGUI\ADD, ilGlobalTemplateInterface\addJavaScript(), ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilGlobalTemplateInterface\get(), getAllowMove(), getCategoryText(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), getLabelText(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getShowSavePhrase(), getShowWizard(), ilTextInputGUI\getSize(), getUseOtherAnswer(), 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:

◆ 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 }

◆ setShowSavePhrase()

ilMatrixRowWizardInputGUI::setShowSavePhrase ( bool  $a_value)

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

128 : void
129 {
130 $this->show_save_phrase = $a_value;
131 }

◆ 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 }
$index
Definition: metadata.php:145

References $index, and 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 28 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().

◆ $labeltext

string ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

◆ $show_save_phrase

bool ilMatrixRowWizardInputGUI::$show_save_phrase = false
protected

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

Referenced by getShowSavePhrase().

◆ $show_wizard

bool ilMatrixRowWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilGlobalTemplateInterface ilMatrixRowWizardInputGUI::$tpl
protected

Definition at line 26 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 27 of file class.ilMatrixRowWizardInputGUI.php.

Referenced by getValues().


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