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

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 getUseOtherAnswer ()
 
 setUseOtherAnswer (bool $a_value)
 
 getCategoryCount ()
 
 setShowNeutralCategory (bool $a_value)
 
 getShowNeutralCategory ()
 
 setNeutralCategoryTitle (string $a_title)
 
 getNeutralCategoryTitle ()
 
 setValue ($a_value)
 
 setValues (SurveyCategories $a_values)
 
 getValues ()
 
 setAllowMove (bool $a_allow_move)
 
 getAllowMove ()
 
 setShowWizard (bool $a_value)
 
 getShowWizard ()
 
 setCategoryText (string $a_text)
 
 getCategoryText ()
 
 getDisabledScale ()
 
 setDisabledScale (bool $a_value)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getNeutralScaleInput ()
 
 getNeutralInput ()
 
 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 Member Functions

 calcNeutralCategoryScale ()
 
- 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)
 

Protected Attributes

ILIAS Survey InternalGUIService $gui
 
ilGlobalTemplateInterface $tpl
 
SurveyCategories $values = null
 
bool $allowMove = false
 
bool $disabled_scale = true
 
bool $show_wizard = false
 
string $categorytext
 
bool $show_neutral_category = false
 
string $neutral_category_title
 
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...
 

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.ilCategoryWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextInputGUI.

Definition at line 37 of file class.ilCategoryWizardInputGUI.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('answer');
51 $this->use_other_answer = false;
52
53 $this->setMaxLength(1000); // #6218
54 $this->gui = $DIC->survey()->internal()->gui();
55 }
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

◆ calcNeutralCategoryScale()

ilCategoryWizardInputGUI::calcNeutralCategoryScale ( )
protected

Definition at line 75 of file class.ilCategoryWizardInputGUI.php.

75 : int
76 {
77 if (is_object($this->values)) {
78 $scale = 0;
79 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
80 $cat = $this->values->getCategory($i);
81 if ($cat->neutral == 0) {
82 $scale += 1;
83 }
84 }
85 return $scale + 1;
86 }
87
88 return 99;
89 }

◆ checkInput()

ilCategoryWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextInputGUI.

Definition at line 197 of file class.ilCategoryWizardInputGUI.php.

197 : bool
198 {
200 $foundvalues = $this->getInput();
201 $neutral_scale = $this->getNeutralScaleInput();
202 $neutral = $this->getNeutralInput();
203
204 if (count($foundvalues) > 0) {
205 // check answers
206 if (is_array($foundvalues['answer'] ?? false)) {
207 foreach ($foundvalues['answer'] as $idx => $answervalue) {
208 if (((strlen($answervalue ?? "")) == 0) && ($this->getRequired() && (!isset($foundvalues['other'][$idx])))) {
209 $this->setAlert($lng->txt("msg_input_is_required"));
210 return false;
211 }
212 }
213 }
214 // check neutral column
215 /* see #33267
216 if (array_key_exists('neutral', $foundvalues)) {
217 if ((strlen($neutral) == 0) && ($this->getRequired())) {
218 $this->setAlert($lng->txt("msg_input_is_required"));
219 return false;
220 }
221 }*/
222 // check scales
223 if (isset($foundvalues['scale'])) {
224 foreach ($foundvalues['scale'] as $scale) {
225 //scales required
226 if ((strlen($scale ?? "")) == 0) {
227 $this->setAlert($lng->txt("msg_input_is_required"));
228 return false;
229 }
230 //scales positive number
231 if (!ctype_digit($scale) || $scale <= 0) {
232 $this->setAlert($lng->txt("msg_input_only_positive_numbers"));
233 return false;
234 }
235 }
236 //scales no duplicates.
237 if (count(array_unique($foundvalues['scale'])) !== count($foundvalues['scale'])) {
238 $this->setAlert($lng->txt("msg_duplicate_scale"));
239 return false;
240 }
241 }
242
243 // check neutral column scale
244 if ($neutral_scale != "") {
245 if (isset($foundvalues['scale'])) {
246 if (in_array($neutral_scale, $foundvalues['scale'])) {
247 $this->setAlert($lng->txt("msg_duplicate_scale"));
248 return false;
249 }
250 }
251 }
252 } else {
253 $this->setAlert($lng->txt("msg_input_is_required"));
254 return false;
255 }
256 return $this->checkSubItemsInput();
257 }

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

+ Here is the call graph for this function:

◆ getAllowMove()

ilCategoryWizardInputGUI::getAllowMove ( )

Definition at line 162 of file class.ilCategoryWizardInputGUI.php.

162 : bool
163 {
164 return $this->allowMove;
165 }

References $allowMove.

◆ getCategoryCount()

ilCategoryWizardInputGUI::getCategoryCount ( )

Definition at line 67 of file class.ilCategoryWizardInputGUI.php.

67 : int
68 {
69 if (!is_object($this->values)) {
70 return 0;
71 }
72 return $this->values->getCategoryCount();
73 }

◆ getCategoryText()

ilCategoryWizardInputGUI::getCategoryText ( )

Definition at line 182 of file class.ilCategoryWizardInputGUI.php.

182 : string
183 {
184 return $this->categorytext;
185 }

References $categorytext.

◆ getDisabledScale()

ilCategoryWizardInputGUI::getDisabledScale ( )

Definition at line 187 of file class.ilCategoryWizardInputGUI.php.

187 : bool
188 {
190 }

References $disabled_scale.

◆ getInput()

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

Reimplemented from ilTextInputGUI.

Definition at line 259 of file class.ilCategoryWizardInputGUI.php.

259 : array
260 {
261 $val = $this->arrayArray($this->getPostVar());
263 return $val;
264 }
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:

◆ getNeutralCategoryTitle()

ilCategoryWizardInputGUI::getNeutralCategoryTitle ( )

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

106 : string
107 {
109 }

References $neutral_category_title.

◆ getNeutralInput()

ilCategoryWizardInputGUI::getNeutralInput ( )

Definition at line 271 of file class.ilCategoryWizardInputGUI.php.

271 : string
272 {
273 $val = $this->strArray($this->getPostVar());
274 return $val["neutral"];
275 }

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:

◆ getNeutralScaleInput()

ilCategoryWizardInputGUI::getNeutralScaleInput ( )

Definition at line 266 of file class.ilCategoryWizardInputGUI.php.

266 : string
267 {
268 return $this->str($this->getPostVar() . '_neutral_scale');
269 }

References ilFormPropertyGUI\getPostVar(), and ilFormPropertyGUI\str().

Referenced by checkInput().

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

◆ getShowNeutralCategory()

ilCategoryWizardInputGUI::getShowNeutralCategory ( )

Definition at line 96 of file class.ilCategoryWizardInputGUI.php.

References $show_neutral_category.

◆ getShowWizard()

ilCategoryWizardInputGUI::getShowWizard ( )

Definition at line 172 of file class.ilCategoryWizardInputGUI.php.

172 : bool
173 {
174 return $this->show_wizard;
175 }

References $show_wizard.

◆ getUseOtherAnswer()

ilCategoryWizardInputGUI::getUseOtherAnswer ( )

Definition at line 57 of file class.ilCategoryWizardInputGUI.php.

57 : bool
58 {
60 }

References $use_other_answer.

◆ getValues()

ilCategoryWizardInputGUI::getValues ( )

Definition at line 152 of file class.ilCategoryWizardInputGUI.php.

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

References $values.

◆ insert()

ilCategoryWizardInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

Definition at line 277 of file class.ilCategoryWizardInputGUI.php.

279 : void {
281
282 $neutral_category = null;
283 $tpl = new ilTemplate("tpl.prop_categorywizardinput.html", true, true, "components/ILIAS/SurveyQuestionPool");
284 if (is_object($this->values)) {
285 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
286 $cat = $this->values->getCategory($i);
287 if (!$cat->neutral) {
288 $tpl->setCurrentBlock("prop_text_propval");
289 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($cat->title));
291 $tpl->setCurrentBlock("prop_scale_propval");
293 "PROPERTY_VALUE",
294 ilLegacyFormElementsUtil::prepareFormOutput($this->values->getScale($i))
295 );
297
298 if ($this->getUseOtherAnswer()) {
299 $tpl->setCurrentBlock("other_answer_checkbox");
300 $tpl->setVariable("POST_VAR", $this->getPostVar());
301 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
302 $tpl->setVariable("ROW_NUMBER", $i);
303 if ($cat->other) {
304 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
305 }
307 }
308
309 if ($this->getAllowMove()) {
310 $tpl->setCurrentBlock("move");
311 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
312 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
313 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
314 $tpl->setVariable("UP_BUTTON", $this->gui->symbol()->glyph("up")->render());
315 $tpl->setVariable("DOWN_BUTTON", $this->gui->symbol()->glyph("down")->render());
317 }
318
319 $tpl->setCurrentBlock("row");
320 $tpl->setVariable("POST_VAR", $this->getPostVar());
321 $tpl->setVariable("ROW_NUMBER", $i);
322 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
323 $tpl->setVariable("SIZE", $this->getSize());
324 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
325 if ($this->getDisabled()) {
326 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
327 }
328
329 $tpl->setVariable("SCALE_ID", $this->getPostVar() . "[scale][$i]");
330 if ($this->getDisabledScale()) {
331 $tpl->setVariable("DISABLED_SCALE", " disabled=\"disabled\"");
332 }
333
334 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
335 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
336 $tpl->setVariable("ADD_BUTTON", $this->gui->symbol()->glyph("add")->render());
337 $tpl->setVariable("REMOVE_BUTTON", $this->gui->symbol()->glyph("remove")->render());
339 } else {
340 $neutral_category = $cat;
341 }
342 }
343 }
344
345
346 if ($this->getShowNeutralCategory()) {
347 if (is_object($neutral_category) && strlen($neutral_category->title ?? "")) {
348 $tpl->setCurrentBlock("prop_text_neutral_propval");
350 "PROPERTY_VALUE",
351 ilLegacyFormElementsUtil::prepareFormOutput($neutral_category->title)
352 );
354 }
355 if ($this->getNeutralCategoryTitle() !== '') {
356 $tpl->setCurrentBlock("neutral_category_title");
357 $tpl->setVariable("NEUTRAL_COLS", ($this->getUseOtherAnswer()) ? 4 : 3);
359 "CATEGORY_TITLE",
361 );
363 }
364 $tpl->setCurrentBlock("prop_scale_neutral_propval");
365 $scale = (is_object($neutral_category) && $neutral_category->scale > 0) ? $neutral_category->scale : $this->values->getNewScale();
368
369 if ($this->getUseOtherAnswer()) {
370 $tpl->touchBlock('other_answer_neutral');
371 }
372
373 $tpl->setCurrentBlock('neutral_row');
374 $tpl->setVariable("POST_VAR", $this->getPostVar());
375 $tpl->setVariable("ID", $this->getPostVar() . "_neutral");
376 $tpl->setVariable("SIZE", $this->getSize());
377 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
378 if ($this->getDisabled()) {
379 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
380 }
381 $tpl->setVariable("SCALE_ID", $this->getPostVar() . "_neutral_scale");
382 if ($this->getDisabledScale()) {
383 $tpl->setVariable("DISABLED_SCALE", " disabled=\"disabled\"");
384 }
386 }
387
388 if ($this->getUseOtherAnswer()) {
389 $tpl->setCurrentBlock('other_answer_title');
390 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
392 }
393
394 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
395 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
396 $tpl->setVariable("SCALE_TEXT", $lng->txt('scale'));
397 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
398
399 $a_tpl->setCurrentBlock("prop_generic");
400 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
401 $a_tpl->parseCurrentBlock();
402
404 $tpl->addJavaScript("assets/js/ServiceFormWizardInput.js");
405 $tpl->addJavaScript("assets/js/categorywizard.js");
406 }
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.
touchBlock(string $block)
overwrites ITX::touchBlock.
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.

◆ setAllowMove()

ilCategoryWizardInputGUI::setAllowMove ( bool  $a_allow_move)

Definition at line 157 of file class.ilCategoryWizardInputGUI.php.

157 : void
158 {
159 $this->allowMove = $a_allow_move;
160 }

◆ setCategoryText()

ilCategoryWizardInputGUI::setCategoryText ( string  $a_text)

Definition at line 177 of file class.ilCategoryWizardInputGUI.php.

177 : void
178 {
179 $this->categorytext = $a_text;
180 }

◆ setDisabledScale()

ilCategoryWizardInputGUI::setDisabledScale ( bool  $a_value)

Definition at line 192 of file class.ilCategoryWizardInputGUI.php.

192 : void
193 {
194 $this->disabled_scale = $a_value;
195 }

◆ setNeutralCategoryTitle()

ilCategoryWizardInputGUI::setNeutralCategoryTitle ( string  $a_title)

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

101 : void
102 {
103 $this->neutral_category_title = $a_title;
104 }

◆ setShowNeutralCategory()

ilCategoryWizardInputGUI::setShowNeutralCategory ( bool  $a_value)

Definition at line 91 of file class.ilCategoryWizardInputGUI.php.

91 : void
92 {
93 $this->show_neutral_category = $a_value;
94 }

◆ setShowWizard()

ilCategoryWizardInputGUI::setShowWizard ( bool  $a_value)

Definition at line 167 of file class.ilCategoryWizardInputGUI.php.

167 : void
168 {
169 $this->show_wizard = $a_value;
170 }

◆ setUseOtherAnswer()

ilCategoryWizardInputGUI::setUseOtherAnswer ( bool  $a_value)

Definition at line 62 of file class.ilCategoryWizardInputGUI.php.

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

◆ setValue()

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

Reimplemented from ilTextInputGUI.

Definition at line 114 of file class.ilCategoryWizardInputGUI.php.

114 : void
115 {
116 $this->values = new SurveyCategories();
117 if (is_array($a_value)) {
118 if (is_array($a_value['answer'])) {
119 foreach ($a_value['answer'] as $index => $value) {
120 $this->values->addCategory(
121 $value,
122 $a_value['other'][$index] ?? 0,
123 0,
124 null,
125 isset($a_value['scale'][$index]) && (int) $a_value['scale'][$index] > 0
126 ? (int) $a_value['scale'][$index]
127 : null
128 );
129 }
130 }
131 }
132 if (array_key_exists('neutral', $a_value)) {
133 $scale = $this->str($this->postvar . '_neutral_scale');
134 $scale = ($scale === "")
135 ? null
136 : (int) $scale;
137 $this->values->addCategory(
138 $a_value['neutral'],
139 0,
140 1,
141 null,
142 $scale
143 );
144 }
145 }

References ilTextInputGUI\$value, and ilFormPropertyGUI\str().

+ Here is the call graph for this function:

◆ setValues()

ilCategoryWizardInputGUI::setValues ( SurveyCategories  $a_values)

Definition at line 147 of file class.ilCategoryWizardInputGUI.php.

147 : void
148 {
149 $this->values = $a_values;
150 }

Field Documentation

◆ $allowMove

bool ilCategoryWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $categorytext

string ilCategoryWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

◆ $disabled_scale

bool ilCategoryWizardInputGUI::$disabled_scale = true
protected

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

Referenced by getDisabledScale().

◆ $gui

ILIAS Survey InternalGUIService ilCategoryWizardInputGUI::$gui
protected

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

◆ $neutral_category_title

string ilCategoryWizardInputGUI::$neutral_category_title
protected

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

Referenced by getNeutralCategoryTitle().

◆ $show_neutral_category

bool ilCategoryWizardInputGUI::$show_neutral_category = false
protected

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

Referenced by getShowNeutralCategory().

◆ $show_wizard

bool ilCategoryWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilGlobalTemplateInterface ilCategoryWizardInputGUI::$tpl
protected

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

◆ $use_other_answer

bool ilCategoryWizardInputGUI::$use_other_answer
protected

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

Referenced by getUseOtherAnswer().

◆ $values

SurveyCategories ilCategoryWizardInputGUI::$values = null
protected

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

Referenced by getValues().


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