adding some strings
[moodle-linuxchix.git] / lib / pear / HTML / QuickForm / Rule.php
blob74e2a0014b9db8ca3570477506b18e1d50e47115
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
4 // | PHP version 4.0 |
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Bertrand Mansion <bmansion@mamasam.com> |
17 // +----------------------------------------------------------------------+
19 // $Id$
21 class HTML_QuickForm_Rule
23 /**
24 * Name of the rule to use in validate method
26 * This property is used in more global rules like Callback and Regex
27 * to determine which callback and which regex is to be used for validation
29 * @var string
30 * @access public
32 var $name;
34 /**
35 * Validates a value
37 * @access public
38 * @abstract
40 function validate($value)
42 return true;
45 /**
46 * Sets the rule name
48 * @access public
50 function setName($ruleName)
52 $this->name = $ruleName;
55 /**
56 * Returns the javascript test (the test should return true if the value is INVALID)
58 * @param mixed Options for the rule
59 * @access public
60 * @return array first element is code to setup validation, second is the check itself
62 function getValidationScript($options = null)
64 return array('', '');