root/trunk/patForms/Element/Hidden.php

Revision 256, 3.5 kB (checked in by schst, 3 years ago)

Adjusted the subpackage to Element to match all other files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * hidden patForms element that builds hidden input fields.
4  *
5  * $Id$
6  *
7  * @access        protected
8  * @package        patForms
9  * @subpackage    Element
10  * @author        Sebastian Mordziol <argh@php-tools.net>
11  */
12  
13 /**
14  * hidden patForms element that builds hidden input fields.
15  *
16  * $Id$
17  *
18  * @access        protected
19  * @package        patForms
20  * @subpackage    Element
21  * @author        Sebastian Mordziol <argh@php-tools.net>
22  * @license        LGPL, see license.txt for details
23  */
24 class patForms_Element_Hidden extends patForms_Element
25 {
26    /**
27     * Stores the name of the element - this is used mainly by the patForms
28     * error management and should be set in every element class.
29     * @access    public
30     */
31     var $elementName    =    'Hidden';
32
33    /**
34     * the type of the element - set this to the type of element you are creating
35     * if you want to use the {@link patForms_Element::element2html()} method to
36     * create the final HTML tag for your element.
37     *
38     * @access    public
39     * @see        patForms_Element::element2html()
40     */
41     var $elementType    =    array(    "html"    =>    "input" );
42     
43    /**
44     * set here which attributes you want to include in the element if you want to use
45     * the {@link patForms_Element::convertDefinition2Attributes()} method to automatically
46     * convert the values from your element definition into element attributes.
47     *
48     * @access    protected
49     * @see        patForms_Element::convertDefinition2Attribute()
50     */
51     var    $attributeDefinition    =    array(   
52             
53             "id"            =>    array(    "required"        =>    false,
54                                         "format"        =>    "string",
55                                         "outputFormats"    =>    array( "html" ),
56                                     ),
57             "name"            =>    array(    "required"        =>    true,
58                                         "format"        =>    "string",
59                                         "outputFormats"    =>    array( "html" ),
60                                         "modifiers"        =>    array( "insertSpecials" => array() ),
61                                     ),
62             "default"        =>    array(    "required"        =>    false,
63                                         "format"        =>    "string",
64                                         "outputFormats"    =>    array(),
65                                     ),
66             "value"            =>    array(    "required"        =>    false,
67                                         "format"        =>    "string",
68                                         "outputFormats"    =>    array( "html" ),
69                                     ),
70             "onchange"        =>    array(    "required"        =>    false,
71                                         "format"        =>    "string",
72                                         "outputFormats"    =>    array( "html" ),
73                                         "modifiers"        =>    array( "insertSpecials" => array() ),
74                                     ),
75             "format"        =>    array(    "required"        =>    false,
76                                         "format"        =>    "string",
77                                         "outputFormats"    =>    array(),
78                                     ),
79             "label"            =>    array(    "required"        =>    false,
80                                         "format"        =>    "string",
81                                         "outputFormats"    =>    array(),
82                                         "modifiers"        =>    array( "insertSpecials" => array() ),
83                                     ),
84         );
85
86     /**
87      *    define error codes an messages for each form element
88      *
89      *  @access private
90      *  @var    array    $validatorErrorCodes
91      */
92     var    $validatorErrorCodes  =   array();
93         
94    /**
95     * element creation method for the 'HTML' format in the 'default' form mode.
96     *
97     * @access    public
98     * @param    mixed    value of the element
99     * @return    mixed    $element    The element, or false if failed.
100     */
101     function serializeHtmlDefault( $value )
102     {
103         return $this->createHiddenTag( $value );
104     }
105     
106    /**
107     * element creation method for the 'HTML' format in the 'readonly' form mode.
108     * Very simple; just returns the stored element value.
109     *
110     * @access    public
111     * @param    mixed    value of the element
112     * @return    string    $value    The element's value
113     */
114     function serializeHtmlReadonly( $value )
115     {
116         return $this->createHiddenTag( $value );
117     }
118
119    /**
120     * validates the element.
121     *
122     * @access    public
123     * @param    mixed    value of the element
124     * @return    bool    $isValid    True if element could be validated, false otherwise.
125     */
126     function validateElement( $value )
127     {
128         return true;
129     }
130 }
131 ?>
132
Note: See TracBrowser for help on using the browser.