jenkins-bot has submitted this change and it was merged.

Change subject: Set taborder for Special:ListFiles
......................................................................


Set taborder for Special:ListFiles

Order: Items per page, name prefix (if there's no miser mode), username, and 
submit button

Bug: 43556
Change-Id: Ic0ce1893c3da8e127584cbc90a400d45e3d715f6
---
M includes/Pager.php
M includes/Xml.php
M includes/specials/SpecialListfiles.php
3 files changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Matmarex: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Pager.php b/includes/Pager.php
index c2bd364..c7f51a3 100644
--- a/includes/Pager.php
+++ b/includes/Pager.php
@@ -1172,11 +1172,15 @@
        /**
         * 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();
        }
 
diff --git a/includes/Xml.php b/includes/Xml.php
index 223061a..d5501fe 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -741,9 +741,10 @@
         * 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>";
 
@@ -763,7 +764,7 @@
                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' );
                }
 
diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index f508b7c..070cdea 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -255,7 +255,7 @@
        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',
@@ -265,6 +265,7 @@
                                        'size' => '40',
                                        'maxlength' => '255',
                                        'id' => 'mw-ilsearch',
+                                       'tabindex' => 2,
                                )
                        );
                }
@@ -272,6 +273,7 @@
                        'size' => '40',
                        'maxlength' => '255',
                        'id' => 'mw-listfiles-user',
+                       'tabindex' => 3,
                ) );
 
                return Html::openElement( 'form',
@@ -279,7 +281,7 @@
                ) .
                        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";

-- 
To view, visit https://gerrit.wikimedia.org/r/49595
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0ce1893c3da8e127584cbc90a400d45e3d715f6
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to