Add blanket support for mediawiki ui via globals
[lhc/web/wiklou.git] / includes / htmlform / HTMLTextField.php
index 57f0a72..10bc67f 100644 (file)
@@ -41,26 +41,25 @@ class HTMLTextField extends HTMLFormField {
                # 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 'email':
-                                       $attribs['type'] = 'email';
-                                       break;
                                case 'int':
-                                       $attribs['type'] = 'number';
+                                       $type = 'number';
                                        break;
                                case 'float':
-                                       $attribs['type'] = 'number';
+                                       $type = 'number';
                                        $attribs['step'] = 'any';
                                        break;
                                # Pass through
+                               case 'email':
                                case 'password':
                                case 'file':
-                                       $attribs['type'] = $this->mParams['type'];
+                               case 'url':
+                                       $type = $this->mParams['type'];
                                        break;
                        }
                }
-
-               return Html::element( 'input', $attribs );
+               return Html::input( $this->mName, $value, $type, $attribs );
        }
 }