Public Member Functions | Private Attributes

ilRegExpInputGUI Class Reference
[Services/Form]

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

Detailed Description

This class represents a regular expression input property in a property form.

Author:
Roland Küstermann <roland.kuestermann@kit.edu>
Version:
$Id$

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


Constructor & Destructor Documentation

ilRegExpInputGUI::__construct ( a_title = "",
a_postvar = "" 
)

Constructor.

Parameters:
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:


Member Function Documentation

ilRegExpInputGUI::checkInput (  ) 

Check input, strip slashes etc.

set alert, if input is not ok.

Returns:
boolean Input ok, true/false

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

Returns:
string

Definition at line 81 of file class.ilRegExpInputGUI.php.

        {
                return $this->pattern;
        }

ilRegExpInputGUI::setPattern ( pattern  ) 

set pattern

Parameters:
string regular expression pattern

Definition at line 71 of file class.ilRegExpInputGUI.php.

References $pattern.

        {
                $this->pattern = $pattern;
        }


Field Documentation

ilRegExpInputGUI::$pattern [private]

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

Referenced by setPattern().


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