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

ilGlobalTemplateInterface $tpl
 
SurveyCategories $values = null
 
bool $allowMove = false
 
bool $disabled_scale = true
 
bool $show_wizard = false
 
bool $show_save_phrase = 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->show_save_phrase = false;
51 $this->categorytext = $lng->txt('answer');
52 $this->use_other_answer = false;
53
54 $this->setMaxLength(1000); // #6218
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)
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

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

References $i.

◆ checkInput()

ilCategoryWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextInputGUI.

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

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

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

154 : bool
155 {
156 return $this->allowMove;
157 }

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 174 of file class.ilCategoryWizardInputGUI.php.

174 : string
175 {
176 return $this->categorytext;
177 }

References $categorytext.

◆ getDisabledScale()

ilCategoryWizardInputGUI::getDisabledScale ( )

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

189 : bool
190 {
192 }

References $disabled_scale.

◆ getInput()

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

Reimplemented from ilTextInputGUI.

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

261 : array
262 {
263 $val = $this->arrayArray($this->getPostVar());
265 return $val;
266 }
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 273 of file class.ilCategoryWizardInputGUI.php.

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

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 268 of file class.ilCategoryWizardInputGUI.php.

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

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.

◆ getShowSavePhrase()

ilCategoryWizardInputGUI::getShowSavePhrase ( )

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

184 : bool
185 {
187 }

References $show_save_phrase.

◆ getShowWizard()

ilCategoryWizardInputGUI::getShowWizard ( )

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

164 : bool
165 {
166 return $this->show_wizard;
167 }

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 144 of file class.ilCategoryWizardInputGUI.php.

145 {
146 return $this->values;
147 }
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 279 of file class.ilCategoryWizardInputGUI.php.

281 : void {
283
284 $neutral_category = null;
285 $tpl = new ilTemplate("tpl.prop_categorywizardinput.html", true, true, "Modules/SurveyQuestionPool");
286 if (is_object($this->values)) {
287 for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
288 $cat = $this->values->getCategory($i);
289 if (!$cat->neutral) {
290 $tpl->setCurrentBlock("prop_text_propval");
291 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($cat->title));
293 $tpl->setCurrentBlock("prop_scale_propval");
295 "PROPERTY_VALUE",
296 ilLegacyFormElementsUtil::prepareFormOutput($this->values->getScale($i))
297 );
299
300 if ($this->getUseOtherAnswer()) {
301 $tpl->setCurrentBlock("other_answer_checkbox");
302 $tpl->setVariable("POST_VAR", $this->getPostVar());
303 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
304 $tpl->setVariable("ROW_NUMBER", $i);
305 if ($cat->other) {
306 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
307 }
309 }
310
311 if ($this->getAllowMove()) {
312 $tpl->setCurrentBlock("move");
313 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
314 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
315 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
319 }
320
321 $tpl->setCurrentBlock("row");
322 $tpl->setVariable("POST_VAR", $this->getPostVar());
323 $tpl->setVariable("ROW_NUMBER", $i);
324 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
325 $tpl->setVariable("SIZE", $this->getSize());
326 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
327 if ($this->getDisabled()) {
328 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
329 }
330
331 $tpl->setVariable("SCALE_ID", $this->getPostVar() . "[scale][$i]");
332 if ($this->getDisabledScale()) {
333 $tpl->setVariable("DISABLED_SCALE", " disabled=\"disabled\"");
334 }
335
336 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
337 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
341 } else {
342 $neutral_category = $cat;
343 }
344 }
345 }
346
347 if ($this->getShowWizard()) {
348 $tpl->setCurrentBlock("wizard");
349 $tpl->setVariable("CMD_WIZARD", 'cmd[addPhrase]');
350 $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.svg'));
351 $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
353 }
354
355 if ($this->getShowSavePhrase()) {
356 $tpl->setCurrentBlock('savephrase');
357 $tpl->setVariable("POST_VAR", $this->getPostVar());
358 $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
360 }
361
362 if ($this->getShowNeutralCategory()) {
363 if (is_object($neutral_category) && strlen($neutral_category->title)) {
364 $tpl->setCurrentBlock("prop_text_neutral_propval");
366 "PROPERTY_VALUE",
367 ilLegacyFormElementsUtil::prepareFormOutput($neutral_category->title)
368 );
370 }
371 if ($this->getNeutralCategoryTitle() !== '') {
372 $tpl->setCurrentBlock("neutral_category_title");
373 $tpl->setVariable("NEUTRAL_COLS", ($this->getUseOtherAnswer()) ? 4 : 3);
375 "CATEGORY_TITLE",
377 );
379 }
380 $tpl->setCurrentBlock("prop_scale_neutral_propval");
381 $scale = (is_object($neutral_category) && $neutral_category->scale > 0) ? $neutral_category->scale : $this->values->getNewScale();
384
385 if ($this->getUseOtherAnswer()) {
386 $tpl->touchBlock('other_answer_neutral');
387 }
388
389 $tpl->setCurrentBlock('neutral_row');
390 $tpl->setVariable("POST_VAR", $this->getPostVar());
391 $tpl->setVariable("ID", $this->getPostVar() . "_neutral");
392 $tpl->setVariable("SIZE", $this->getSize());
393 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
394 if ($this->getDisabled()) {
395 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
396 }
397 $tpl->setVariable("SCALE_ID", $this->getPostVar() . "_neutral_scale");
398 if ($this->getDisabledScale()) {
399 $tpl->setVariable("DISABLED_SCALE", " disabled=\"disabled\"");
400 }
402 }
403
404 if ($this->getUseOtherAnswer()) {
405 $tpl->setCurrentBlock('other_answer_title');
406 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
408 }
409
410 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
411 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
412 $tpl->setVariable("SCALE_TEXT", $lng->txt('scale'));
413 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
414
415 $a_tpl->setCurrentBlock("prop_generic");
416 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
417 $a_tpl->parseCurrentBlock();
418
420 $tpl->addJavaScript("./Services/Form/js/ServiceFormWizardInput.js");
421 $tpl->addJavaScript("./Modules/SurveyQuestionPool/Categories/js/categorywizard.js");
422 }
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.
touchBlock(string $block)
overwrites ITX::touchBlock.
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.

◆ setAllowMove()

ilCategoryWizardInputGUI::setAllowMove ( bool  $a_allow_move)

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

149 : void
150 {
151 $this->allowMove = $a_allow_move;
152 }

◆ setCategoryText()

ilCategoryWizardInputGUI::setCategoryText ( string  $a_text)

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

169 : void
170 {
171 $this->categorytext = $a_text;
172 }

◆ setDisabledScale()

ilCategoryWizardInputGUI::setDisabledScale ( bool  $a_value)

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

194 : void
195 {
196 $this->disabled_scale = $a_value;
197 }

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

◆ setShowSavePhrase()

ilCategoryWizardInputGUI::setShowSavePhrase ( bool  $a_value)

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

179 : void
180 {
181 $this->show_save_phrase = $a_value;
182 }

◆ setShowWizard()

ilCategoryWizardInputGUI::setShowWizard ( bool  $a_value)

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

159 : void
160 {
161 $this->show_wizard = $a_value;
162 }

◆ 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($value, $a_value['other'][$index] ?? 0, 0, null, $a_value['scale'][$index] ?? null);
121 }
122 }
123 }
124 if (array_key_exists('neutral', $a_value)) {
125 $scale = $this->str($this->postvar . '_neutral_scale');
126 $scale = ($scale === "")
127 ? null
128 : (int) $scale;
129 $this->values->addCategory(
130 $a_value['neutral'],
131 0,
132 1,
133 null,
134 $scale
135 );
136 }
137 }
$index
Definition: metadata.php:145

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

+ Here is the call graph for this function:

◆ setValues()

ilCategoryWizardInputGUI::setValues ( SurveyCategories  $a_values)

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

139 : void
140 {
141 $this->values = $a_values;
142 }

Field Documentation

◆ $allowMove

bool ilCategoryWizardInputGUI::$allowMove = false
protected

Definition at line 28 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 29 of file class.ilCategoryWizardInputGUI.php.

Referenced by getDisabledScale().

◆ $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_save_phrase

bool ilCategoryWizardInputGUI::$show_save_phrase = false
protected

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

Referenced by getShowSavePhrase().

◆ $show_wizard

bool ilCategoryWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilGlobalTemplateInterface ilCategoryWizardInputGUI::$tpl
protected

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

Referenced by getValues().


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