This class represents a regular expression input property in a property form. More...
Inheritance diagram for ilRegExpInputGUI:
Collaboration diagram for ilRegExpInputGUI:Public Member Functions | |
| __construct ($a_title="", $a_postvar="") | |
| Constructor. | |
| checkInput () | |
| Check input, strip slashes etc. | |
| setPattern ($pattern) | |
| set pattern | |
| getPattern () | |
| return pattern | |
Private Attributes | |
| $pattern | |
This class represents a regular expression input property in a property form.
Definition at line 31 of file class.ilRegExpInputGUI.php.
| ilRegExpInputGUI::__construct | ( | $ | a_title = "", |
|
| $ | a_postvar = "" | |||
| ) |
Constructor.
| string | $a_title Title | |
| string | $a_postvar Post Variable |
Reimplemented from ilTextInputGUI.
Definition at line 41 of file class.ilRegExpInputGUI.php.
References ilFormPropertyGUI::setType().
{
parent::__construct($a_title, $a_postvar);
$this->setType("feedurl");
}
Here is the call graph for this function:| ilRegExpInputGUI::checkInput | ( | ) |
Check input, strip slashes etc.
set alert, if input is not ok.
Reimplemented from ilTextInputGUI.
Definition at line 52 of file class.ilRegExpInputGUI.php.
References $lng, ilTextInputGUI::$value, ilFormPropertyGUI::getPostVar(), ilFormPropertyGUI::getRequired(), ilFormPropertyGUI::setAlert(), and ilUtil::stripSlashes().
{
global $lng;
$value = ilUtil::stripSlashes($_POST[$this->getPostVar()]);
if (!$this->getRequired() && strcasecmp($value, "")== 0)
return true;
$result = preg_match ($this->pattern, $value);
if (!$result)
$this->setAlert($lng->txt("msg_input_does_not_match_regexp"));
return $result;
}
Here is the call graph for this function:| ilRegExpInputGUI::getPattern | ( | ) |
return pattern
Definition at line 81 of file class.ilRegExpInputGUI.php.
{
return $this->pattern;
}
| ilRegExpInputGUI::setPattern | ( | $ | pattern | ) |
set pattern
| string | regular expression pattern |
Definition at line 71 of file class.ilRegExpInputGUI.php.
References $pattern.
{
$this->pattern = $pattern;
}
ilRegExpInputGUI::$pattern [private] |
Definition at line 33 of file class.ilRegExpInputGUI.php.
Referenced by setPattern().
1.7.1