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. | |
| 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. | |
Protected Attributes | |
| $value | |
| $maxlength = 200 | |
| $size = 40 | |
This class represents a text property in a property form.
Definition at line 31 of file class.ilTextInputGUI.php.
| ilTextInputGUI::__construct | ( | $ | a_title = "", |
|
| $ | a_postvar = "" | |||
| ) |
Constructor.
| string | $a_title Title | |
| string | $a_postvar Post Variable |
Reimplemented from ilFormPropertyGUI.
Reimplemented in ilFeedUrlInputGUI, and ilRegExpInputGUI.
Definition at line 43 of file class.ilTextInputGUI.php.
References setInputType().
{
parent::__construct($a_title, $a_postvar);
$this->setInputType("text");
}
Here is the call graph for this function:| ilTextInputGUI::checkInput | ( | ) |
Check input, strip slashes etc.
set alert, if input is not ok.
Reimplemented from ilFormPropertyGUI.
Reimplemented in ilFeedUrlInputGUI, and ilRegExpInputGUI.
Definition at line 147 of file class.ilTextInputGUI.php.
References $lng, ilSubEnabledFormPropertyGUI::checkSubItemsInput(), ilFormPropertyGUI::getPostVar(), ilFormPropertyGUI::getRequired(), 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;
}
return $this->checkSubItemsInput();
}
Here is the call graph for this function:| ilTextInputGUI::getInputType | ( | ) |
get input type
public
Definition at line 136 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.
Definition at line 84 of file class.ilTextInputGUI.php.
Referenced by insert().
{
return $this->maxlength;
}
Here is the caller graph for this function:| ilTextInputGUI::getSize | ( | ) |
Get Size.
Definition at line 114 of file class.ilTextInputGUI.php.
Referenced by insert().
{
return $this->size;
}
Here is the caller graph for this function:| ilTextInputGUI::getValue | ( | ) |
Get Value.
Definition at line 64 of file class.ilTextInputGUI.php.
Referenced by insert().
{
return $this->value;
}
Here is the caller graph for this function:| ilTextInputGUI::insert | ( | &$ | a_tpl | ) |
Insert property html.
Definition at line 168 of file class.ilTextInputGUI.php.
References ilFormPropertyGUI::getDisabled(), ilFormPropertyGUI::getFieldId(), getInputType(), getMaxLength(), ilFormPropertyGUI::getPostVar(), getSize(), getValue(), and ilUtil::prepareFormOutput().
{
$a_tpl->setCurrentBlock("prop_text");
switch($this->getInputType())
{
case 'password':
$a_tpl->setVariable('PROP_INPUT_TYPE','password');
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("PROPERTY_VALUE",
ilUtil::prepareFormOutput($this->getValue()));
$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
| string | input type password | text |
Definition at line 126 of file class.ilTextInputGUI.php.
Referenced by __construct().
{
$this->input_type = $a_type;
}
Here is the caller graph for this function:| ilTextInputGUI::setMaxLength | ( | $ | a_maxlength | ) |
Set Max Length.
| int | $a_maxlength Max Length |
Definition at line 74 of file class.ilTextInputGUI.php.
{
$this->maxlength = $a_maxlength;
}
| ilTextInputGUI::setSize | ( | $ | a_size | ) |
Set Size.
| int | $a_size Size |
Definition at line 94 of file class.ilTextInputGUI.php.
{
$this->size = $a_size;
}
| ilTextInputGUI::setValue | ( | $ | a_value | ) |
Set Value.
| string | $a_value Value |
Definition at line 54 of file class.ilTextInputGUI.php.
Referenced by setValueByArray().
{
$this->value = $a_value;
}
Here is the caller graph for this function:| ilTextInputGUI::setValueByArray | ( | $ | a_values | ) |
Set value by array.
| array | $a_values value array |
Definition at line 104 of file class.ilTextInputGUI.php.
References ilFormPropertyGUI::getPostVar(), and setValue().
{
$this->setValue($a_values[$this->getPostVar()]);
}
Here is the call graph for this function:ilTextInputGUI::$maxlength = 200 [protected] |
Reimplemented in ilFeedUrlInputGUI.
Definition at line 34 of file class.ilTextInputGUI.php.
ilTextInputGUI::$size = 40 [protected] |
Reimplemented in ilFeedUrlInputGUI.
Definition at line 35 of file class.ilTextInputGUI.php.
ilTextInputGUI::$value [protected] |
Reimplemented in ilFeedUrlInputGUI.
Definition at line 33 of file class.ilTextInputGUI.php.
Referenced by ilRegExpInputGUI::checkInput().
1.7.1