ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 26 of file class.ilMatrixRowWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextInputGUI.

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

40 {
41 global $DIC;
42
43 $this->lng = $DIC->language();
44 $this->tpl = $DIC["tpl"];
45 $lng = $DIC->language();
46
47 parent::__construct($a_title, $a_postvar);
48
49 $this->show_wizard = false;
50 $this->categorytext = $lng->txt('row_text');
51 $this->use_other_answer = false;
52 $this->values = new SurveyCategories();
53
54 $this->setMaxLength(1000); // #6803
55 $this->gui = $DIC->survey()->internal()->gui();
56 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
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 132 of file class.ilMatrixRowWizardInputGUI.php.

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

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

96 : bool
97 {
98 return $this->allowMove;
99 }

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

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

116 : string
117 {
118 return $this->categorytext;
119 }

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

154 : array
155 {
156 $val = $this->arrayArray($this->getPostVar());
158 return $val;
159 }
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 126 of file class.ilMatrixRowWizardInputGUI.php.

126 : string
127 {
128 return $this->labeltext;
129 }

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowWizard()

ilMatrixRowWizardInputGUI::getShowWizard ( )

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

106 : bool
107 {
108 return $this->show_wizard;
109 }

References $show_wizard.

◆ getUseOtherAnswer()

ilMatrixRowWizardInputGUI::getUseOtherAnswer ( )

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

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

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

161 : void
162 {
164
165 $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "components/ILIAS/SurveyQuestionPool");
166 if (is_object($this->values)) {
167 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
168 $cat = $this->values->getCategory($i);
169 $tpl->setCurrentBlock("prop_text_propval");
170 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->title));
172 $tpl->setCurrentBlock("prop_label_propval");
173 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $cat->label));
175
176 if ($this->getUseOtherAnswer()) {
177 $tpl->setCurrentBlock("other_answer_checkbox");
178 $tpl->setVariable("POST_VAR", $this->getPostVar());
179 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
180 $tpl->setVariable("ROW_NUMBER", $i);
181 if ($cat->other) {
182 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
183 }
185 }
186
187 if ($this->getAllowMove()) {
188 $tpl->setCurrentBlock("move");
189 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
190 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
191 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
192 $tpl->setVariable("UP_BUTTON", $this->gui->symbol()->glyph("up")->render());
193 $tpl->setVariable("DOWN_BUTTON", $this->gui->symbol()->glyph("down")->render());
195 }
196
197 $tpl->setCurrentBlock("row");
198 $tpl->setVariable("POST_VAR", $this->getPostVar());
199 $tpl->setVariable("ROW_NUMBER", $i);
200 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
201 $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
202 $tpl->setVariable("SIZE", $this->getSize());
203 $tpl->setVariable("SIZE_LABEL", 15);
204 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
205 if ($this->getDisabled()) {
206 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
207 $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
208 }
209
210 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
211 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
212 $tpl->setVariable("ADD_BUTTON", $this->gui->symbol()->glyph("add")->render());
213 $tpl->setVariable("REMOVE_BUTTON", $this->gui->symbol()->glyph("remove")->render());
215 }
216 }
217
218 if ($this->getUseOtherAnswer()) {
219 $tpl->setCurrentBlock('other_answer_title');
220 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
222 }
223
224 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
225 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
226 $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
227 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
228
229 $a_tpl->setCurrentBlock("prop_generic");
230 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
231 $a_tpl->parseCurrentBlock();
232
234 $tpl->addJavaScript("assets/js/ServiceFormWizardInput.js");
235 $tpl->addJavaScript("assets/js/matrixrowwizard.js");
236 }
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 91 of file class.ilMatrixRowWizardInputGUI.php.

91 : void
92 {
93 $this->allowMove = $a_allow_move;
94 }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText ( string  $a_text)

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

111 : void
112 {
113 $this->categorytext = $a_text;
114 }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText ( string  $a_text)

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

121 : void
122 {
123 $this->labeltext = $a_text;
124 }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard ( bool  $a_value)

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

101 : void
102 {
103 $this->show_wizard = $a_value;
104 }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer ( bool  $a_value)

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

63 : void
64 {
65 $this->use_other_answer = $a_value;
66 }

◆ setValue()

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

Reimplemented from ilTextInputGUI.

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

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

References ilTextInputGUI\$value.

◆ setValues()

ilMatrixRowWizardInputGUI::setValues ( SurveyCategories  $a_values)

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

81 : void
82 {
83 $this->values = $a_values;
84 }

Field Documentation

◆ $allowMove

bool ilMatrixRowWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $categorytext

string ilMatrixRowWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

◆ $gui

ILIAS Survey InternalGUIService ilMatrixRowWizardInputGUI::$gui
protected

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

◆ $labeltext

string ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

◆ $show_wizard

bool ilMatrixRowWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilGlobalTemplateInterface ilMatrixRowWizardInputGUI::$tpl
protected

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

Referenced by insert().

◆ $use_other_answer

bool ilMatrixRowWizardInputGUI::$use_other_answer
protected

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

Referenced by getUseOtherAnswer().

◆ $values

SurveyCategories ilMatrixRowWizardInputGUI::$values = null
protected

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

Referenced by getValues().


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