ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMatrixRowWizardInputGUI Class Reference

This class represents a survey question category wizard property in a property form. More...

+ Inheritance diagram for ilMatrixRowWizardInputGUI:
+ Collaboration diagram for ilMatrixRowWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 getUseOtherAnswer ()
 
 setUseOtherAnswer ($a_value)
 
 setValue ($a_value)
 Set Value. More...
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 setAllowMove ($a_allow_move)
 Set allow move. More...
 
 getAllowMove ()
 Get allow move. More...
 
 setShowWizard ($a_value)
 
 getShowWizard ()
 
 setCategoryText ($a_text)
 
 getCategoryText ()
 
 setLabelText ($a_text)
 
 getLabelText ()
 
 setShowSavePhrase ($a_value)
 
 getShowSavePhrase ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setDataSourceSubmitOnSelection ($a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl ($a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Attributes

 $values = array()
 
 $allowMove = false
 
 $show_wizard = false
 
 $show_save_phrase = false
 
 $categorytext
 
 $labeltext
 
 $use_other_answer
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $ajax_datasource_commit = FALSE
 
 $ajax_datasource_commit_url
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

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
Version
Id
class.ilMatrixRowWizardInputGUI.php 23642 2010-04-26 12:31:50Z hschottm

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

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

48 {
49 parent::__construct($a_title, $a_postvar);
50 global $lng;
51 $this->show_wizard = false;
52 $this->show_save_phrase = false;
53 $this->categorytext = $lng->txt('row_text');
54 $this->use_other_answer = false;
55
56 $this->setMaxLength(1000); // #6803
57 }
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:40

References $lng, and ilTextInputGUI\setMaxLength().

+ 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.

Returns
boolean Input ok, true/false

Reimplemented from ilTextInputGUI.

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

176 {
177 global $lng;
178 if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()]);
179 $foundvalues = $_POST[$this->getPostVar()];
180 if (is_array($foundvalues))
181 {
182 // check answers
183 if (is_array($foundvalues['answer']))
184 {
185 foreach ($foundvalues['answer'] as $idx => $answervalue)
186 {
187 if (((strlen($answervalue)) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx])))
188 {
189 $this->setAlert($lng->txt("msg_input_is_required"));
190 return FALSE;
191 }
192 }
193 }
194 }
195 else
196 {
197 $this->setAlert($lng->txt("msg_input_is_required"));
198 return FALSE;
199 }
200
201 return $this->checkSubItemsInput();
202 }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
$_POST['username']
Definition: cron.php:12

References $_POST, $lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashesRecursive().

+ Here is the call graph for this function:

◆ getAllowMove()

ilMatrixRowWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

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

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

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

References $categorytext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getLabelText()

ilMatrixRowWizardInputGUI::getLabelText ( )

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

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowSavePhrase()

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

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

References $show_save_phrase.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowWizard()

ilMatrixRowWizardInputGUI::getShowWizard ( )

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

References $show_wizard.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getUseOtherAnswer()

ilMatrixRowWizardInputGUI::getUseOtherAnswer ( )

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

References $use_other_answer.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValues()

ilMatrixRowWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

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

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

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

210 {
211 global $lng;
212
213 $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool");
214 $i = 0;
215 if (is_object($this->values))
216 {
217 for ($i = 0; $i < $this->values->getCategoryCount(); $i++)
218 {
219 $cat = $this->values->getCategory($i);
220 $tpl->setCurrentBlock("prop_text_propval");
221 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->title));
222 $tpl->parseCurrentBlock();
223 $tpl->setCurrentBlock("prop_label_propval");
224 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->label));
225 $tpl->parseCurrentBlock();
226
227 if ($this->getUseOtherAnswer())
228 {
229 $tpl->setCurrentBlock("other_answer_checkbox");
230 $tpl->setVariable("POST_VAR", $this->getPostVar());
231 $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
232 $tpl->setVariable("ROW_NUMBER", $i);
233 if ($cat->other)
234 {
235 $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
236 }
237 $tpl->parseCurrentBlock();
238 }
239
240 if ($this->getAllowMove())
241 {
242 $tpl->setCurrentBlock("move");
243 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
244 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
245 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
246 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
247 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
248 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
249 $tpl->parseCurrentBlock();
250 }
251
252 $tpl->setCurrentBlock("row");
253 $tpl->setVariable("POST_VAR", $this->getPostVar());
254 $tpl->setVariable("ROW_NUMBER", $i);
255 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
256 $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
257 $tpl->setVariable("SIZE", $this->getSize());
258 $tpl->setVariable("SIZE_LABEL", 15);
259 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
260 if ($this->getDisabled())
261 {
262 $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
263 $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
264 }
265
266 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
267 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
268 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
269 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
270 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
271 $tpl->parseCurrentBlock();
272 }
273 }
274
275 if ($this->getShowWizard())
276 {
277 $tpl->setCurrentBlock("wizard");
278 $tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']');
279 $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.svg'));
280 $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
281 $tpl->parseCurrentBlock();
282 }
283
284 if ($this->getShowSavePhrase())
285 {
286 $tpl->setCurrentBlock('savephrase');
287 $tpl->setVariable("POST_VAR", $this->getPostVar());
288 $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
289 $tpl->parseCurrentBlock();
290 }
291
292 if ($this->getUseOtherAnswer())
293 {
294 $tpl->setCurrentBlock('other_answer_title');
295 $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
296 $tpl->parseCurrentBlock();
297 }
298
299 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
300 $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
301 $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
302 $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
303
304 $a_tpl->setCurrentBlock("prop_generic");
305 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
306 $a_tpl->parseCurrentBlock();
307
308 global $tpl;
309 $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
310 $tpl->addJavascript("./Modules/SurveyQuestionPool/templates/default/matrixrowwizard.js");
311 }
global $tpl
Definition: ilias.php:8
getFieldId()
Get Post Variable.
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
getMaxLength()
Get Max Length.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $lng, $tpl, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), getAllowMove(), getCategoryText(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), getLabelText(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getShowSavePhrase(), getShowWizard(), ilTextInputGUI\getSize(), getUseOtherAnswer(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

+ Here is the call graph for this function:

◆ setAllowMove()

ilMatrixRowWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

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

116 {
117 $this->allowMove = $a_allow_move;
118 }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText (   $a_text)

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

141 {
142 $this->categorytext = $a_text;
143 }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText (   $a_text)

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

151 {
152 $this->labeltext = $a_text;
153 }

◆ setShowSavePhrase()

ilMatrixRowWizardInputGUI::setShowSavePhrase (   $a_value)

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

161 {
162 $this->show_save_phrase = $a_value;
163 }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard (   $a_value)

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

131 {
132 $this->show_wizard = $a_value;
133 }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer (   $a_value)

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

65 {
66 $this->use_other_answer = ($a_value) ? true : false;
67 }

◆ setValue()

ilMatrixRowWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilTextInputGUI.

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

75 {
76 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
77 $this->values = new SurveyCategories();
78 if (is_array($a_value))
79 {
80 if (is_array($a_value['answer']))
81 {
82 foreach ($a_value['answer'] as $index => $value)
83 {
84 $this->values->addCategory($value, $a_value['other'][$index]);
85 }
86 }
87 }
88 }
Class SurveyCategories.

References ilTextInputGUI\$value.

◆ setValues()

ilMatrixRowWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

96 {
97 $this->values = $a_values;
98 }

Field Documentation

◆ $allowMove

ilMatrixRowWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $categorytext

ilMatrixRowWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

◆ $labeltext

ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

◆ $show_save_phrase

ilMatrixRowWizardInputGUI::$show_save_phrase = false
protected

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

Referenced by getShowSavePhrase().

◆ $show_wizard

ilMatrixRowWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $use_other_answer

ilMatrixRowWizardInputGUI::$use_other_answer
protected

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

Referenced by getUseOtherAnswer().

◆ $values

ilMatrixRowWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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