ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTextInputGUI Class Reference

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

+ Inheritance diagram for ilTextInputGUI:
+ Collaboration diagram for ilTextInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 getValue ()
 Get Value.
 setValidationRegexp ($a_value)
 Set validation regexp.
 getValidationRegexp ()
 Get validation regexp.
 setMaxLength ($a_maxlength)
 Set Max Length.
 getMaxLength ()
 Get Max Length.
 setSize ($a_size)
 Set Size.
 setValueByArray ($a_values)
 Set value by array.
 getSize ()
 Get Size.
 setInputType ($a_type)
 set input type
 getInputType ()
 get input type
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 setSubformMode ($a_subformmode)
 Set Subform Mode.
 getSubformMode ()
 Get Subform Mode.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
- Public Member Functions inherited from ilFormPropertyGUI
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.

Protected Attributes

 $value
 $maxlength = 200
 $size = 40
 $validationRegexp
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 $subformmode = "bottom"
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a text property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilColorPickerInputGUI, ilFeedUrlInputGUI, and ilRegExpInputGUI.

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

References setInputType().

{
parent::__construct($a_title, $a_postvar);
$this->setInputType("text");
$this->validationRegexp = "";
}

+ Here is the call graph for this function:

Member Function Documentation

ilTextInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilRegExpInputGUI, ilColorPickerInputGUI, and ilFeedUrlInputGUI.

Definition at line 169 of file class.ilTextInputGUI.php.

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

{
global $lng;
$_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
else if (strlen($this->getValidationRegexp()))
{
if (!preg_match($this->getValidationRegexp(), $_POST[$this->getPostVar()]))
{
$this->setAlert($lng->txt("msg_wrong_format"));
return FALSE;
}
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilTextInputGUI::getInputType ( )

get input type

public

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

Referenced by insert().

{
return $this->input_type;
}

+ Here is the caller graph for this function:

ilTextInputGUI::getMaxLength ( )

Get Max Length.

Returns
int Max Length

Definition at line 106 of file class.ilTextInputGUI.php.

References $maxlength.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilTextInputGUI::getSize ( )

Get Size.

Returns
int Size

Definition at line 136 of file class.ilTextInputGUI.php.

References $size.

Referenced by insert().

{
return $this->size;
}

+ Here is the caller graph for this function:

ilTextInputGUI::getValidationRegexp ( )

Get validation regexp.

Returns
string regexp

Definition at line 86 of file class.ilTextInputGUI.php.

References $validationRegexp.

Referenced by checkInput().

+ Here is the caller graph for this function:

ilTextInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by insert().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilTextInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 197 of file class.ilTextInputGUI.php.

References ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getInputType(), getMaxLength(), ilFormPropertyGUI\getPostVar(), getSize(), getValue(), and ilUtil\prepareFormOutput().

{
if (strlen($this->getValue()))
{
$a_tpl->setCurrentBlock("prop_text_propval");
$a_tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("prop_text");
switch($this->getInputType())
{
case 'password':
$a_tpl->setVariable('PROP_INPUT_TYPE','password');
break;
case 'hidden':
$a_tpl->setVariable('PROP_INPUT_TYPE','hidden');
break;
case 'text':
default:
$a_tpl->setVariable('PROP_INPUT_TYPE','text');
}
$a_tpl->setVariable("POST_VAR", $this->getPostVar());
$a_tpl->setVariable("ID", $this->getFieldId());
$a_tpl->setVariable("SIZE", $this->getSize());
$a_tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$a_tpl->setVariable("DISABLED",
" disabled=\"disabled\"");
}
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilTextInputGUI::setInputType (   $a_type)

set input type

public

Parameters
stringinput type password | text

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

Referenced by __construct(), and ilPDNewsBlockGUI\editSettings().

{
$this->input_type = $a_type;
}

+ Here is the caller graph for this function:

ilTextInputGUI::setMaxLength (   $a_maxlength)

Set Max Length.

Parameters
int$a_maxlengthMax Length

Definition at line 96 of file class.ilTextInputGUI.php.

Referenced by ilObjMediaCastGUI\initAddCastItemForm(), and ilObjWikiGUI\initSettingsForm().

{
$this->maxlength = $a_maxlength;
}

+ Here is the caller graph for this function:

ilTextInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

Definition at line 116 of file class.ilTextInputGUI.php.

Referenced by assTextQuestionGUI\editQuestion(), ilObjPaymentSettingsGUI\generalSettingsObject(), ilCalendarRecurrenceGUI\initForm(), ilObjChatServerGUI\initForm(), ilObjUserGUI\initForm(), and ilECSSettingsGUI\initSettingsForm().

{
$this->size = $a_size;
}

+ Here is the caller graph for this function:

ilTextInputGUI::setValidationRegexp (   $a_value)

Set validation regexp.

Parameters
string$a_valueregexp

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

{
$this->validationRegexp = $a_value;
}
ilTextInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 126 of file class.ilTextInputGUI.php.

References ilFormPropertyGUI\getPostVar(), and setValue().

{
$this->setValue($a_values[$this->getPostVar()]);
}

+ Here is the call graph for this function:

Field Documentation

ilTextInputGUI::$maxlength = 200
protected

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

Referenced by getMaxLength().

ilTextInputGUI::$size = 40
protected

Definition at line 35 of file class.ilTextInputGUI.php.

Referenced by getSize().

ilTextInputGUI::$validationRegexp
protected

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

Referenced by getValidationRegexp().

ilTextInputGUI::$value
protected

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

Referenced by ilRegExpInputGUI\checkInput(), and getValue().


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