X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXml.php;h=67f365848dca129a60bfe7c7d1ef2e52540b753f;hb=700e0ee0669fc267c597a12d5a1f30c0454b1d95;hp=120312dd96727ad2b2d5e6e2fd0f82f3efd7e9f1;hpb=8197acca32e783418a73f74edba810b8c8a212c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index 120312dd96..67f365848d 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -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) @@ -574,7 +576,8 @@ class Xml { */ public static function textarea( $name, $content, $cols = 40, $rows = 5, $attribs = array() ) { return self::element( 'textarea', - array( 'name' => $name, + array( + 'name' => $name, 'id' => $name, 'cols' => $cols, 'rows' => $rows