Merge "[JobQueue] Added support for approximate FIFO job queues."
[lhc/web/wiklou.git] / includes / Xml.php
index 120312d..2f8ba0f 100644 (file)
@@ -59,6 +59,7 @@ class Xml {
         * The values are passed to Sanitizer::encodeAttribute.
         * Return null if no attributes given.
         * @param $attribs Array of attributes for an XML element
+        * @throws MWException
         * @return null|string
         */
        public static function expandAttributes( $attribs ) {
@@ -198,15 +199,16 @@ class Xml {
                } else {
                        $encYear = '';
                }
-               return Xml::label( wfMessage( 'year' )->text(), 'year' ) . ' '.
-                       Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) . ' '.
-                       Xml::label( wfMessage( 'month' )->text(), 'month' ) . ' '.
-                       Xml::monthSelector( $encMonth, -1 );
+               $inputAttribs = array( 'id' => 'year', 'maxlength' => 4, 'size' => 7 );
+               return self::label( wfMessage( 'year' )->text(), 'year' ) . ' '.
+                       Html::input( 'year', $encYear, 'number', $inputAttribs ) . ' '.
+                       self::label( wfMessage( 'month' )->text(), 'month' ) . ' '.
+                       self::monthSelector( $encMonth, -1 );
        }
 
        /**
         * Construct a language selector appropriate for use in a form or preferences
-        * 
+        *
         * @param string $selected The language code of the selected language
         * @param boolean $customisedOnly If true only languages which have some content are listed
         * @param string $inLanguage The ISO code of the language to display the select list in (optional)