Merge "[JobQueue] Added support for approximate FIFO job queues."
[lhc/web/wiklou.git] / includes / Xml.php
index 505cb7f..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 ) {
@@ -166,7 +167,7 @@ class Xml {
                if( is_null( $selected ) )
                        $selected = '';
                if( !is_null( $allmonths ) )
-                       $options[] = self::option( wfMsg( 'monthsall' ), $allmonths, $selected === $allmonths );
+                       $options[] = self::option( wfMessage( 'monthsall' )->text(), $allmonths, $selected === $allmonths );
                for( $i = 1; $i < 13; $i++ )
                        $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i );
                return self::openElement( 'select', array( 'id' => $id, 'name' => 'month', 'class' => 'mw-month-selector' ) )
@@ -198,15 +199,16 @@ class Xml {
                } else {
                        $encYear = '';
                }
-               return Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
-                       Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) . ' '.
-                       Xml::label( wfMsg( 'month' ), '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)
@@ -772,7 +774,7 @@ class Xml {
                foreach( $fields as $labelmsg => $input ) {
                        $id = "mw-$labelmsg";
                        $form .= Xml::openElement( 'tr', array( 'id' => $id ) );
-                       $form .= Xml::tags( 'td', array('class' => 'mw-label'), wfMsgExt( $labelmsg, array('parseinline') ) );
+                       $form .= Xml::tags( 'td', array('class' => 'mw-label'), wfMessage( $labelmsg )->parse() );
                        $form .= Xml::openElement( 'td', array( 'class' => 'mw-input' ) ) . $input . Xml::closeElement( 'td' );
                        $form .= Xml::closeElement( 'tr' );
                }
@@ -780,7 +782,7 @@ class Xml {
                if( $submitLabel ) {
                        $form .= Xml::openElement( 'tr' );
                        $form .= Xml::tags( 'td', array(), '' );
-                       $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMsg( $submitLabel ) ) . Xml::closeElement( 'td' );
+                       $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMessage( $submitLabel )->text() ) . Xml::closeElement( 'td' );
                        $form .= Xml::closeElement( 'tr' );
                }