X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/5517dbf1904795f710675847cd2a49f64009286c..914ba42493e01bc0f79053b0d3cd6348fcdfa0f8:/cookbooks/dmca/files/default/html/HTML/QuickForm/Rule.php diff --git a/cookbooks/dmca/files/default/html/HTML/QuickForm/Rule.php b/cookbooks/dmca/files/default/html/HTML/QuickForm/Rule.php new file mode 100644 index 000000000..9d9502039 --- /dev/null +++ b/cookbooks/dmca/files/default/html/HTML/QuickForm/Rule.php @@ -0,0 +1,82 @@ + + * @copyright 2001-2011 The PHP Group + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @version CVS: $Id$ + * @link http://pear.php.net/package/HTML_QuickForm + */ + +/** + * Abstract base class for QuickForm validation rules + * + * @category HTML + * @package HTML_QuickForm + * @author Bertrand Mansion + * @version Release: 3.2.16 + * @since 3.2 + * @abstract + */ +class HTML_QuickForm_Rule +{ + /** + * Name of the rule to use in validate method + * + * This property is used in more global rules like Callback and Regex + * to determine which callback and which regex is to be used for validation + * + * @var string + * @access public + */ + var $name; + + /** + * Validates a value + * + * @access public + * @abstract + */ + function validate($value) + { + return true; + } + + /** + * Sets the rule name + * + * @param string rule name + * @access public + */ + function setName($ruleName) + { + $this->name = $ruleName; + } + + /** + * Returns the javascript test (the test should return true if the value is INVALID) + * + * @param mixed Options for the rule + * @access public + * @return array first element is code to setup validation, second is the check itself + * @abstract + */ + function getValidationScript($options = null) + { + return array('', ''); + } +} +?> \ No newline at end of file