}
function getInputHTML( $value ) {
- global $wgHtml5;
$attribs = array(
'id' => $this->mID,
'name' => $this->mName,
$attribs['disabled'] = 'disabled';
}
- if ( $wgHtml5 ) {
- # TODO: Enforce pattern, step, required, readonly on the server
- # side as well
- foreach ( array( 'min', 'max', 'pattern', 'title', 'step',
- 'placeholder' ) as $param ) {
- if ( isset( $this->mParams[$param] ) ) {
- $attribs[$param] = $this->mParams[$param];
- }
+ # TODO: Enforce pattern, step, required, readonly on the server side as
+ # well
+ foreach ( array( 'min', 'max', 'pattern', 'title', 'step',
+ 'placeholder' ) as $param ) {
+ if ( isset( $this->mParams[$param] ) ) {
+ $attribs[$param] = $this->mParams[$param];
}
- foreach ( array( 'required', 'autofocus', 'multiple', 'readonly' )
- as $param ) {
- if ( isset( $this->mParams[$param] ) ) {
- $attribs[$param] = '';
- }
+ }
+ foreach ( array( 'required', 'autofocus', 'multiple', 'readonly' ) as
+ $param ) {
+ if ( isset( $this->mParams[$param] ) ) {
+ $attribs[$param] = '';
}
}
# here, rather than creating a new class for each one which
# is essentially just a clone of this one.
if ( isset( $this->mParams['type'] ) ) {
- # Options that apply only to HTML5
- if( $wgHtml5 ){
- switch ( $this->mParams['type'] ) {
- case 'email':
- $attribs['type'] = 'email';
- break;
- case 'int':
- $attribs['type'] = 'number';
- break;
- case 'float':
- $attribs['type'] = 'number';
- $attribs['step'] = 'any';
- break;
- }
- }
- # Options that apply to HTML4 as well
- switch( $this->mParams['type'] ) {
+ switch ( $this->mParams['type'] ) {
+ case 'email':
+ $attribs['type'] = 'email';
+ break;
+ case 'int':
+ $attribs['type'] = 'number';
+ break;
+ case 'float':
+ $attribs['type'] = 'number';
+ $attribs['step'] = 'any';
+ break;
# Pass through
case 'password':
case 'file':
}
function getInputHTML( $value ) {
- global $wgHtml5;
$attribs = array(
'id' => $this->mID,
'name' => $this->mName,
$attribs['readonly'] = 'readonly';
}
- if ( $wgHtml5 ) {
- foreach ( array( 'required', 'autofocus' ) as $param ) {
- if ( isset( $this->mParams[$param] ) ) {
- $attribs[$param] = '';
- }
+ foreach ( array( 'required', 'autofocus' ) as $param ) {
+ if ( isset( $this->mParams[$param] ) ) {
+ $attribs[$param] = '';
}
}
-
return Html::element( 'textarea', $attribs, $value );
}