ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. 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

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

References $lng.

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  }
global $lng
Definition: privfeed.php:40

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 173 of file class.ilMatrixRowWizardInputGUI.php.

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

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

◆ getAllowMove()

ilMatrixRowWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

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

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getCategoryText()

ilMatrixRowWizardInputGUI::getCategoryText ( )

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

References $categorytext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getLabelText()

ilMatrixRowWizardInputGUI::getLabelText ( )

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

References $labeltext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getShowSavePhrase()

ilMatrixRowWizardInputGUI::getShowSavePhrase ( )

Definition at line 163 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 133 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 57 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 103 of file class.ilMatrixRowWizardInputGUI.php.

References $values.

◆ insert()

ilMatrixRowWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 207 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.

208  {
209  global $lng;
210 
211  $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool");
212  $i = 0;
213  if (is_object($this->values))
214  {
215  for ($i = 0; $i < $this->values->getCategoryCount(); $i++)
216  {
217  $cat = $this->values->getCategory($i);
218  $tpl->setCurrentBlock("prop_text_propval");
219  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->title));
220  $tpl->parseCurrentBlock();
221  $tpl->setCurrentBlock("prop_label_propval");
222  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->label));
223  $tpl->parseCurrentBlock();
224 
225  if ($this->getUseOtherAnswer())
226  {
227  $tpl->setCurrentBlock("other_answer_checkbox");
228  $tpl->setVariable("POST_VAR", $this->getPostVar());
229  $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][$i]");
230  $tpl->setVariable("ROW_NUMBER", $i);
231  if ($cat->other)
232  {
233  $tpl->setVariable("CHECKED_OTHER", ' checked="checked"');
234  }
235  $tpl->parseCurrentBlock();
236  }
237 
238  if ($this->getAllowMove())
239  {
240  $tpl->setCurrentBlock("move");
241  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
242  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
243  $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
244  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
245  $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
246  $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
247  $tpl->parseCurrentBlock();
248  }
249 
250  $tpl->setCurrentBlock("row");
251  $tpl->setVariable("POST_VAR", $this->getPostVar());
252  $tpl->setVariable("ROW_NUMBER", $i);
253  $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
254  $tpl->setVariable("ID_LABEL", $this->getPostVar() . "[label][$i]");
255  $tpl->setVariable("SIZE", $this->getSize());
256  $tpl->setVariable("SIZE_LABEL", 15);
257  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
258  if ($this->getDisabled())
259  {
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  {
275  $tpl->setCurrentBlock("wizard");
276  $tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']');
277  $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.svg'));
278  $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase'));
279  $tpl->parseCurrentBlock();
280  }
281 
282  if ($this->getShowSavePhrase())
283  {
284  $tpl->setCurrentBlock('savephrase');
285  $tpl->setVariable("POST_VAR", $this->getPostVar());
286  $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase'));
287  $tpl->parseCurrentBlock();
288  }
289 
290  if ($this->getUseOtherAnswer())
291  {
292  $tpl->setCurrentBlock('other_answer_title');
293  $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer'));
294  $tpl->parseCurrentBlock();
295  }
296 
297  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
298  $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText());
299  $tpl->setVariable("LABEL_TEXT", $this->getLabelText());
300  $tpl->setVariable("ACTIONS_TEXT", $lng->txt('actions'));
301 
302  $a_tpl->setCurrentBlock("prop_generic");
303  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
304  $a_tpl->parseCurrentBlock();
305 
306  global $tpl;
307  $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
308  $tpl->addJavascript("./Modules/SurveyQuestionPool/templates/default/matrixrowwizard.js");
309  }
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:40
+ 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 113 of file class.ilMatrixRowWizardInputGUI.php.

114  {
115  $this->allowMove = $a_allow_move;
116  }

◆ setCategoryText()

ilMatrixRowWizardInputGUI::setCategoryText (   $a_text)

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

139  {
140  $this->categorytext = $a_text;
141  }

◆ setLabelText()

ilMatrixRowWizardInputGUI::setLabelText (   $a_text)

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

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

◆ setShowSavePhrase()

ilMatrixRowWizardInputGUI::setShowSavePhrase (   $a_value)

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

159  {
160  $this->show_save_phrase = $a_value;
161  }

◆ setShowWizard()

ilMatrixRowWizardInputGUI::setShowWizard (   $a_value)

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

129  {
130  $this->show_wizard = $a_value;
131  }

◆ setUseOtherAnswer()

ilMatrixRowWizardInputGUI::setUseOtherAnswer (   $a_value)

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

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

◆ setValue()

ilMatrixRowWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

References ilTextInputGUI\$value.

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

◆ setValues()

ilMatrixRowWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

94  {
95  $this->values = $a_values;
96  }

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: