summaryrefslogtreecommitdiff
path: root/includes/htmlform/HTMLTextField.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
commit1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch)
treef1fdd326034e05177596851be6a7127615d81498 /includes/htmlform/HTMLTextField.php
parent9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff)
parentf6d65e533c62f6deb21342d4901ece24497b433e (diff)
Merge commit 'f6d65'
# Conflicts: # skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/htmlform/HTMLTextField.php')
-rw-r--r--includes/htmlform/HTMLTextField.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/htmlform/HTMLTextField.php b/includes/htmlform/HTMLTextField.php
index 10bc67f0..88df49db 100644
--- a/includes/htmlform/HTMLTextField.php
+++ b/includes/htmlform/HTMLTextField.php
@@ -20,6 +20,7 @@ class HTMLTextField extends HTMLFormField {
# @todo Enforce pattern, step, required, readonly on the server side as
# well
$allowedParams = array(
+ 'type',
'min',
'max',
'pattern',
@@ -38,10 +39,13 @@ class HTMLTextField extends HTMLFormField {
$attribs += $this->getAttributes( $allowedParams );
+ # Extract 'type'
+ $type = isset( $attribs['type'] ) ? $attribs['type'] : 'text';
+ unset( $attribs['type'] );
+
# Implement tiny differences between some field variants
# here, rather than creating a new class for each one which
# is essentially just a clone of this one.
- $type = 'text';
if ( isset( $this->mParams['type'] ) ) {
switch ( $this->mParams['type'] ) {
case 'int':
@@ -60,6 +64,7 @@ class HTMLTextField extends HTMLFormField {
break;
}
}
+
return Html::input( $this->mName, $value, $type, $attribs );
}
}