ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrderingTextWizardInputGUI Class Reference

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

+ Inheritance diagram for ilOrderingTextWizardInputGUI:
+ Collaboration diagram for ilOrderingTextWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setDisableActions ($disable_actions)
 
 setDisableText ($disable_text)
 
 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...
 
- 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...
 
 setMultiValues (array $a_values)
 
 render ($a_mode="")
 Render item. 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...
 

Protected Attributes

 $values = array()
 
 $allowMove = false
 
 $disable_text = false
 
 $disable_actions = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $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 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.ilOrderingTextWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 45 of file class.ilOrderingTextWizardInputGUI.php.

46  {
47  parent::__construct($a_title, $a_postvar);
48  $this->validationRegexp = "";
49  }

Member Function Documentation

◆ checkInput()

ilOrderingTextWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 122 of file class.ilOrderingTextWizardInputGUI.php.

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

123  {
124  global $lng;
125 
126  $foundvalues = $_POST[$this->getPostVar()];
127  if (is_array($foundvalues))
128  {
129  foreach ($foundvalues as $idx => $value)
130  {
131  $_POST[$this->getPostVar()][$idx] = ilUtil::stripSlashes($value);
132  if ($this->getRequired() && trim($value) == "")
133  {
134  $this->setAlert($lng->txt("msg_input_is_required"));
135 
136  return false;
137  }
138  else if (strlen($this->getValidationRegexp()))
139  {
140  if (!preg_match($this->getValidationRegexp(), $value))
141  {
142  $this->setAlert($lng->txt("msg_wrong_format"));
143  return FALSE;
144  }
145  }
146  }
147  }
148  else
149  {
150  $this->setAlert($lng->txt("msg_input_is_required"));
151  return FALSE;
152  }
153 
154  return $this->checkSubItemsInput();
155  }
$_POST['username']
Definition: cron.php:12
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
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getAllowMove()

ilOrderingTextWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

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

References $allowMove.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValues()

ilOrderingTextWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

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

References $values.

◆ insert()

ilOrderingTextWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

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

References $tpl, ilTextInputGUI\$value, getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getImagePath(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), ilYuiUtil\initDomEvent(), and ilUtil\prepareFormOutput().

163  {
164  $tpl = new ilTemplate("tpl.prop_textwizardinput.html", true, true, "Modules/TestQuestionPool");
165  $i = 0;
166  foreach ($this->values as $value)
167  {
168  if (strlen($value))
169  {
170  $tpl->setCurrentBlock("prop_text_propval");
171  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value));
172  $tpl->parseCurrentBlock();
173  }
174 
175  if ($this->getAllowMove())
176  {
177  $tpl->setCurrentBlock("move");
178  $tpl->setVariable("MOVE_ID", $this->getFieldId() . "[$i]");
179  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
180  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
181  $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
182  $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png'));
183  $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png'));
184  $tpl->parseCurrentBlock();
185  }
186  $tpl->setCurrentBlock("row");
187  $class = ($i % 2 == 0) ? "even" : "odd";
188  if ($i == 0) $class .= " first";
189  if ($i == count($this->values)-1) $class .= " last";
190  $tpl->setVariable("ROW_CLASS", $class);
191  $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
192  $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
193  $tpl->setVariable("SIZE", $this->getSize());
194  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
195 
196  if($this->getDisabled())
197  {
198  $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
199  }
200 
201  if(!$this->disable_actions)
202  {
203  $tpl->setVariable("ID_ADD_BUTTON", $this->getFieldId() . "[$i]");
204  $tpl->setVariable("ID_REMOVE_BUTTON", $this->getFieldId() . "[$i]");
205  $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
206  $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
207  $tpl->setVariable( "ADD_BUTTON", ilUtil::getImagePath( 'edit_add.png' ) );
208  $tpl->setVariable( "REMOVE_BUTTON", ilUtil::getImagePath( 'edit_remove.png' ) );
209  }
210 
211  if($this->disable_text)
212  {
213  $tpl->setVariable('DISABLED_TEXT', ' readonly="readonly"');
214  }
215 
216  $tpl->parseCurrentBlock();
217  $i++;
218  }
219  $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
220 
221  $a_tpl->setCurrentBlock("prop_generic");
222  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
223  $a_tpl->parseCurrentBlock();
224 
225  global $tpl;
226  include_once "./Services/YUI/classes/class.ilYuiUtil.php";
228  $tpl->addJavascript("./Services/Form/templates/default/textwizard.js");
229  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
getPostVar()
Get Post Variable.
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
static initDomEvent()
Init YUI DomEvent.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ setAllowMove()

ilOrderingTextWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

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

103  {
104  $this->allowMove = $a_allow_move;
105  }

◆ setDisableActions()

ilOrderingTextWizardInputGUI::setDisableActions (   $disable_actions)
Parameters
boolean$disable_actions

Definition at line 54 of file class.ilOrderingTextWizardInputGUI.php.

References $disable_actions.

55  {
56  $this->disable_actions = $disable_actions;
57  }

◆ setDisableText()

ilOrderingTextWizardInputGUI::setDisableText (   $disable_text)
Parameters
boolean$disable_text

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

References $disable_text.

63  {
64  $this->disable_text = $disable_text;
65  }

◆ setValue()

ilOrderingTextWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
array$a_valueValue

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

83  {
84  $this->values = $a_value;
85  }

◆ setValues()

ilOrderingTextWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

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

Field Documentation

◆ $allowMove

ilOrderingTextWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $disable_actions

ilOrderingTextWizardInputGUI::$disable_actions = false
protected

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

Referenced by setDisableActions().

◆ $disable_text

ilOrderingTextWizardInputGUI::$disable_text = false
protected

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

Referenced by setDisableText().

◆ $values

ilOrderingTextWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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