ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 
 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...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. 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

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- 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

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

References $lng, and ilTextInputGUI\setMaxLength().

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

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

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

178  {
179  global $lng;
180  if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()]);
181  $foundvalues = $_POST[$this->getPostVar()];
182  if (is_array($foundvalues))
183  {
184  // check answers
185  if (is_array($foundvalues['answer']))
186  {
187  foreach ($foundvalues['answer'] as $idx => $answervalue)
188  {
189  if (((strlen($answervalue)) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx])))
190  {
191  $this->setAlert($lng->txt("msg_input_is_required"));
192  return FALSE;
193  }
194  }
195  }
196  }
197  else
198  {
199  $this->setAlert($lng->txt("msg_input_is_required"));
200  return FALSE;
201  }
202 
203  return $this->checkSubItemsInput();
204  }
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.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ getAllowMove()

ilMatrixRowWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

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

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

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

References $categorytext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getLabelText()

ilMatrixRowWizardInputGUI::getLabelText ( )

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

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowSavePhrase()

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

Definition at line 167 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 137 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 61 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 107 of file class.ilMatrixRowWizardInputGUI.php.

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

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.

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

118  {
119  $this->allowMove = $a_allow_move;
120  }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText (   $a_text)

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

143  {
144  $this->categorytext = $a_text;
145  }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText (   $a_text)

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

153  {
154  $this->labeltext = $a_text;
155  }

◆ setShowSavePhrase()

ilMatrixRowWizardInputGUI::setShowSavePhrase (   $a_value)

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

163  {
164  $this->show_save_phrase = $a_value;
165  }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard (   $a_value)

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

133  {
134  $this->show_wizard = $a_value;
135  }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer (   $a_value)

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

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

◆ setValue()

ilMatrixRowWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

References ilTextInputGUI\$value.

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

◆ setValues()

ilMatrixRowWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

98  {
99  $this->values = $a_values;
100  }

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: