Subversion Repositories Applications.papyrus

Rev

Rev 320 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 320 Rev 443
1
<?php
1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +----------------------------------------------------------------------+
3
// +----------------------------------------------------------------------+
4
// | PHP version 4.0                                                      |
4
// | PHP version 4.0                                                      |
5
// +----------------------------------------------------------------------+
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997-2003 The PHP Group                                |
6
// | Copyright (c) 1997-2003 The PHP Group                                |
7
// +----------------------------------------------------------------------+
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.0 of the PHP license,       |
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        |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available at through the world-wide-web at                           |
10
// | available at through the world-wide-web at                           |
11
// | http://www.php.net/license/2_02.txt.                                 |
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   |
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          |
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.               |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
15
// +----------------------------------------------------------------------+
16
// | Authors: Bertrand Mansion <bmansion@mamasam.com>                     |
16
// | Authors: Bertrand Mansion <bmansion@mamasam.com>                     |
17
// +----------------------------------------------------------------------+
17
// +----------------------------------------------------------------------+
18
//
18
//
19
// $Id: Rule.php,v 1.1 2005-03-30 08:50:33 jpm Exp $
19
// $Id: Rule.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
20
 
20
 
21
class HTML_QuickForm_Rule
21
class HTML_QuickForm_Rule
22
{
22
{
23
   /**
23
   /**
24
    * Name of the rule to use in validate method
24
    * Name of the rule to use in validate method
25
    *
25
    *
26
    * This property is used in more global rules like Callback and Regex
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
27
    * to determine which callback and which regex is to be used for validation
28
    *
28
    *
29
    * @var  string
29
    * @var  string
30
    * @access   public
30
    * @access   public
31
    */
31
    */
32
    var $name;
32
    var $name;
33
 
33
 
34
   /**
34
   /**
35
    * Validates a value
35
    * Validates a value
36
    * 
36
    * 
37
    * @access public
37
    * @access public
38
    * @abstract
38
    * @abstract
39
    */
39
    */
40
    function validate($value)
40
    function validate($value)
41
    {
41
    {
42
        return true;
42
        return true;
43
    }
43
    }
44
 
44
 
45
   /**
45
   /**
46
    * Sets the rule name
46
    * Sets the rule name
47
    * 
47
    * 
48
    * @access public
48
    * @access public
49
    */
49
    */
50
    function setName($ruleName)
50
    function setName($ruleName)
51
    {
51
    {
52
        $this->name = $ruleName;
52
        $this->name = $ruleName;
53
    }
53
    }
54
 
54
 
55
    /**
55
    /**
56
     * Returns the javascript test (the test should return true if the value is INVALID)
56
     * Returns the javascript test (the test should return true if the value is INVALID)
57
     *
57
     *
58
     * @param     mixed     Options for the rule
58
     * @param     mixed     Options for the rule
59
     * @access    public
59
     * @access    public
60
     * @return    array     first element is code to setup validation, second is the check itself
60
     * @return    array     first element is code to setup validation, second is the check itself
61
     */
61
     */
62
    function getValidationScript($options = null)
62
    function getValidationScript($options = null)
63
    {
63
    {
64
        return array('', '');
64
        return array('', '');
65
    }
65
    }
66
}
66
}
67
?>
67
?>