Order: Items per page, name prefix (if there's no miser mode), username, and submit button
Bug: 43556
Change-Id: Ic0ce1893c3da8e127584cbc90a400d45e3d715f6
/**
* Get a "<select>" element which has options for each of the allowed limits
*
+ * @param $attribs String: Extra attributes to set
* @return String: HTML fragment
*/
- public function getLimitSelect() {
+ public function getLimitSelect( $attribs = array() ) {
$select = new XmlSelect( 'limit', false, $this->mLimit );
$select->addOptions( $this->getLimitSelectList() );
+ foreach ( $attribs as $name => $value ) {
+ $select->setAttribute( $name, $value );
+ }
return $select->getHTML();
}
* Output optionally includes a submit button.
* @param array $fields Associative array, key is the name of a message that contains a description for the field, value is an HTML string containing the appropriate input.
* @param string $submitLabel The name of a message containing a label for the submit button.
+ * @param array $submitAttribs The attributes to add to the submit button
* @return string HTML form.
*/
- public static function buildForm( $fields, $submitLabel = null ) {
+ public static function buildForm( $fields, $submitLabel = null, $submitAttribs = array() ) {
$form = '';
$form .= "<table><tbody>";
if ( $submitLabel ) {
$form .= Xml::openElement( 'tr' );
$form .= Xml::tags( 'td', array(), '' );
- $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMessage( $submitLabel )->text() ) . Xml::closeElement( 'td' );
+ $form .= Xml::openElement( 'td', array( 'class' => 'mw-submit' ) ) . Xml::submitButton( wfMessage( $submitLabel )->text(), $submitAttribs ) . Xml::closeElement( 'td' );
$form .= Xml::closeElement( 'tr' );
}
function getForm() {
global $wgScript, $wgMiserMode;
$inputForm = array();
- $inputForm['table_pager_limit_label'] = $this->getLimitSelect();
+ $inputForm['table_pager_limit_label'] = $this->getLimitSelect( array( 'tabindex' => 1 ) );
if ( !$wgMiserMode ) {
$inputForm['listfiles_search_for'] = Html::input(
'ilsearch',
'size' => '40',
'maxlength' => '255',
'id' => 'mw-ilsearch',
+ 'tabindex' => 2,
)
);
}
'size' => '40',
'maxlength' => '255',
'id' => 'mw-listfiles-user',
+ 'tabindex' => 3,
) );
return Html::openElement( 'form',
) .
Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
- Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
+ Xml::buildForm( $inputForm, 'table_pager_limit_submit', array( 'tabindex' => 4 ) ) .
$this->getHiddenFields( array( 'limit', 'ilsearch', 'user', 'title' ) ) .
Html::closeElement( 'fieldset' ) .
Html::closeElement( 'form' ) . "\n";