ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 $tpl
 
 $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
 $ctrl
 
 $lng
 
 $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 52 of file class.ilMatrixRowWizardInputGUI.php.

References $DIC, ilFormPropertyGUI\$lng, and ilTextInputGUI\setMaxLength().

53  {
54  global $DIC;
55 
56  $this->lng = $DIC->language();
57  $this->tpl = $DIC["tpl"];
58  $lng = $DIC->language();
59 
60  parent::__construct($a_title, $a_postvar);
61 
62  $this->show_wizard = false;
63  $this->show_save_phrase = false;
64  $this->categorytext = $lng->txt('row_text');
65  $this->use_other_answer = false;
66 
67  $this->setMaxLength(1000); // #6803
68  }
global $DIC
Definition: saml.php:7
setMaxLength($a_maxlength)
Set Max Length.
+ 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 183 of file class.ilMatrixRowWizardInputGUI.php.

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

184  {
185  $lng = $this->lng;
186  if (is_array($_POST[$this->getPostVar()])) {
188  }
189  $foundvalues = $_POST[$this->getPostVar()];
190  if (is_array($foundvalues)) {
191  // check answers
192  if (is_array($foundvalues['answer'])) {
193  foreach ($foundvalues['answer'] as $idx => $answervalue) {
194  if (((strlen($answervalue)) == 0) && ($this->getRequired() && (!$foundvalues['other'][$idx]))) {
195  $this->setAlert($lng->txt("msg_input_is_required"));
196  return false;
197  }
198  }
199  }
200  } else {
201  $this->setAlert($lng->txt("msg_input_is_required"));
202  return false;
203  }
204 
205  return $this->checkSubItemsInput();
206  }
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"]
+ Here is the call graph for this function:

◆ getAllowMove()

ilMatrixRowWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

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

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

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

References $categorytext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getLabelText()

ilMatrixRowWizardInputGUI::getLabelText ( )

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

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowSavePhrase()

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

Definition at line 173 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 143 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 70 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 113 of file class.ilMatrixRowWizardInputGUI.php.

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

References $i, ilFormPropertyGUI\$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.

214  {
215  $lng = $this->lng;
216 
217  $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool");
218  $i = 0;
219  if (is_object($this->values)) {
220  for ($i = 0; $i < $this->values->getCategoryCount(); $i++) {
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  $tpl->setCurrentBlock("other_answer_checkbox");
231  $tpl->setVariable("POST_VAR", $this->getPostVar());
232  $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
233  $tpl->setVariable("ROW_NUMBER", $i);
234  if ($cat->other) {
235  $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
236  }
237  $tpl->parseCurrentBlock();
238  }
239 
240  if ($this->getAllowMove()) {
241  $tpl->setCurrentBlock("move");
242  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
243  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
244  $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
245  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
246  $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
247  $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
248  $tpl->parseCurrentBlock();
249  }
250 
251  $tpl->setCurrentBlock("row");
252  $tpl->setVariable("POST_VAR", $this->getPostVar());
253  $tpl->setVariable("ROW_NUMBER", $i);
254  $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
255  $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
256  $tpl->setVariable("SIZE", $this->getSize());
257  $tpl->setVariable("SIZE_LABEL", 15);
258  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
259  if ($this->getDisabled()) {
260  $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
261  $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\"");
262  }
263 
264  $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
265  $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
266  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
267  $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
268  $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
269  $tpl->parseCurrentBlock();
270  }
271  }
272 
273  if ($this->getShowWizard()) {
274  $tpl->setCurrentBlock("wizard");
275  $tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']');
276  $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.svg'));
277  $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
278  $tpl->parseCurrentBlock();
279  }
280 
281  if ($this->getShowSavePhrase()) {
282  $tpl->setCurrentBlock('savephrase');
283  $tpl->setVariable("POST_VAR", $this->getPostVar());
284  $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
285  $tpl->parseCurrentBlock();
286  }
287 
288  if ($this->getUseOtherAnswer()) {
289  $tpl->setCurrentBlock('other_answer_title');
290  $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
291  $tpl->parseCurrentBlock();
292  }
293 
294  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
295  $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
296  $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
297  $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
298 
299  $a_tpl->setCurrentBlock("prop_generic");
300  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
301  $a_tpl->parseCurrentBlock();
302 
303  $tpl = $this->tpl;
304  $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
305  $tpl->addJavascript("./Modules/SurveyQuestionPool/templates/default/matrixrowwizard.js");
306  }
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.
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
$i
Definition: disco.tpl.php:19
+ 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 123 of file class.ilMatrixRowWizardInputGUI.php.

124  {
125  $this->allowMove = $a_allow_move;
126  }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText (   $a_text)

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

149  {
150  $this->categorytext = $a_text;
151  }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText (   $a_text)

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

159  {
160  $this->labeltext = $a_text;
161  }

◆ setShowSavePhrase()

ilMatrixRowWizardInputGUI::setShowSavePhrase (   $a_value)

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

169  {
170  $this->show_save_phrase = $a_value;
171  }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard (   $a_value)

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

139  {
140  $this->show_wizard = $a_value;
141  }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer (   $a_value)

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

76  {
77  $this->use_other_answer = ($a_value) ? true : false;
78  }

◆ setValue()

ilMatrixRowWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

References $index, and ilTextInputGUI\$value.

86  {
87  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyCategories.php";
88  $this->values = new SurveyCategories();
89  if (is_array($a_value)) {
90  if (is_array($a_value['answer'])) {
91  foreach ($a_value['answer'] as $index => $value) {
92  $this->values->addCategory($value, $a_value['other'][$index]);
93  }
94  }
95  }
96  }
$index
Definition: metadata.php:60
Class SurveyCategories.

◆ setValues()

ilMatrixRowWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

104  {
105  $this->values = $a_values;
106  }

Field Documentation

◆ $allowMove

ilMatrixRowWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $categorytext

ilMatrixRowWizardInputGUI::$categorytext
protected

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

Referenced by getCategoryText().

◆ $labeltext

ilMatrixRowWizardInputGUI::$labeltext
protected

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

Referenced by getLabelText().

◆ $show_save_phrase

ilMatrixRowWizardInputGUI::$show_save_phrase = false
protected

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

Referenced by getShowSavePhrase().

◆ $show_wizard

ilMatrixRowWizardInputGUI::$show_wizard = false
protected

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

Referenced by getShowWizard().

◆ $tpl

ilMatrixRowWizardInputGUI::$tpl
protected

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

Referenced by insert().

◆ $use_other_answer

ilMatrixRowWizardInputGUI::$use_other_answer
protected

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

Referenced by getUseOtherAnswer().

◆ $values

ilMatrixRowWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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