* 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 ) {
} 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)
*/
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