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