ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTextWizardInputGUI Class Reference

This class represents a text wizard property in a property form. More...

+ Inheritance diagram for ilTextWizardInputGUI:
+ Collaboration diagram for ilTextWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValues ($a_values)
 Set Values. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValues ()
 Get Values. More...
 
 setAllowMove ($a_allow_move)
 Set allow move. More...
 
 getAllowMove ()
 Get allow move. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 render ($a_mode="")
 
- 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...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 

Protected Attributes

 $tpl
 
 $values = array()
 
 $allowMove = false
 
- 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 text wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC.

48  {
49  global $DIC;
50 
51  $this->lng = $DIC->language();
52  $this->tpl = $DIC["tpl"];
53  parent::__construct($a_title, $a_postvar);
54  $this->validationRegexp = "";
55  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ checkInput()

ilTextWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 112 of file class.ilTextWizardInputGUI.php.

References $_POST, ilFormPropertyGUI\$lng, ilTextInputGUI\$value, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilTextInputGUI\getValidationRegexp(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

113  {
114  $lng = $this->lng;
115 
116  $foundvalues = $_POST[$this->getPostVar()];
117  if (is_array($foundvalues)) {
118  foreach ($foundvalues as $idx => $value) {
119  $_POST[$this->getPostVar()][$idx] = ilUtil::stripSlashes($value);
120  if ($this->getRequired() && trim($value) == "") {
121  $this->setAlert($lng->txt("msg_input_is_required"));
122 
123  return false;
124  } elseif (strlen($this->getValidationRegexp())) {
125  if (!preg_match($this->getValidationRegexp(), $value)) {
126  $this->setAlert($lng->txt("msg_wrong_format"));
127  return false;
128  }
129  }
130  }
131  } elseif ($this->getRequired()) {
132  $this->setAlert($lng->txt("msg_input_is_required"));
133  return false;
134  }
135 
136  return $this->checkSubItemsInput();
137  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
getValidationRegexp()
Get validation regexp.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ getAllowMove()

ilTextWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 102 of file class.ilTextWizardInputGUI.php.

References $allowMove.

Referenced by ilSelectBuilderInputGUI\insert(), and render().

103  {
104  return $this->allowMove;
105  }
+ Here is the caller graph for this function:

◆ getValues()

ilTextWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 82 of file class.ilTextWizardInputGUI.php.

References $values.

◆ insert()

ilTextWizardInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Definition at line 144 of file class.ilTextWizardInputGUI.php.

References render().

145  {
146  $a_tpl->setCurrentBlock("prop_generic");
147  $a_tpl->setVariable("PROP_GENERIC", $this->render());
148  $a_tpl->parseCurrentBlock();
149  }
+ Here is the call graph for this function:

◆ render()

ilTextWizardInputGUI::render (   $a_mode = "")

Definition at line 151 of file class.ilTextWizardInputGUI.php.

References $i, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

Referenced by insert().

152  {
153  $tpl = new ilTemplate("tpl.prop_textwizardinput.html", true, true, "Services/Form");
154  $i = 0;
155  foreach ($this->values as $value) {
156  if (strlen($value)) {
157  $tpl->setCurrentBlock("prop_text_propval");
158  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value));
159  $tpl->parseCurrentBlock();
160  }
161  if ($this->getAllowMove()) {
162  $tpl->setCurrentBlock("move");
163  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
164  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
165  $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
166  $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
167  $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
168  $tpl->parseCurrentBlock();
169  }
170  $tpl->setCurrentBlock("row");
171  $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
172  $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
173  $tpl->setVariable("SIZE", $this->getSize());
174  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
175 
176  if ($this->getDisabled()) {
177  $tpl->setVariable(
178  "DISABLED",
179  " disabled=\"disabled\""
180  );
181  } else {
182  $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
183  $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
184  $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
185  $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
186  }
187 
188  $tpl->parseCurrentBlock();
189  $i++;
190  }
191 
192  $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
193 
194  if (!$this->getDisabled()) {
195  $this->tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
196  $this->tpl->addJavascript("./Services/Form/templates/default/textwizard.js");
197  }
198 
199  return $tpl->get();
200  }
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.
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:
+ Here is the caller graph for this function:

◆ setAllowMove()

ilTextWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 92 of file class.ilTextWizardInputGUI.php.

Referenced by ilObjectCustomUserFieldsGUI\initFieldForm().

93  {
94  $this->allowMove = $a_allow_move;
95  }
+ Here is the caller graph for this function:

◆ setValue()

ilTextWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
array$a_valueValue

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

73  {
74  $this->values = $a_value;
75  }

◆ setValues()

ilTextWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

63  {
64  $this->values = $a_values;
65  }

Field Documentation

◆ $allowMove

ilTextWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $tpl

ilTextWizardInputGUI::$tpl
protected

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

Referenced by render().

◆ $values

ilTextWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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