Split includes/HTMLForm
[lhc/web/wiklou.git] / includes / htmlform / HTMLHiddenField.php
1 <?php
2 class HTMLHiddenField extends HTMLFormField {
3 public function __construct( $params ) {
4 parent::__construct( $params );
5
6 # Per HTML5 spec, hidden fields cannot be 'required'
7 # http://dev.w3.org/html5/spec/states-of-the-type-attribute.html#hidden-state
8 unset( $this->mParams[ 'required' ] );
9 }
10
11 public function getTableRow( $value ) {
12 $params = array();
13 if ( $this->mID ) {
14 $params[ 'id' ] = $this->mID;
15 }
16
17 $this->mParent->addHiddenField( $this->mName, $this->mDefault, $params );
18
19 return '';
20 }
21
22 /**
23 * @since 1.20
24 */
25 public function getDiv( $value ) {
26 return $this->getTableRow( $value );
27 }
28
29 /**
30 * @since 1.20
31 */
32 public function getRaw( $value ) {
33 return $this->getTableRow( $value );
34 }
35
36 public function getInputHTML( $value ) {
37 return '';
38 }
39 }