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

Change subject: Changed Special:GlobalUsers to inherit from AlphabeticPager
......................................................................


Changed Special:GlobalUsers to inherit from AlphabeticPager

Previously, Special:GlobalUsers inherited from UsersPager, which is used to
display Special:ListUsers. The problem with that was that not all of the
controls generated by UsersPager are applicable to GlobalUsers, so some of
them were useless - specifically the "Show only users with edits" and
"Sort by creation date" checkboxes. This addresses bug 57544, and a fix for
this bug is especially useful to allow the implementation of a fix for
bug 33545, which introduces new controls to Special:ListUsers.

Bug: 57544
Change-Id: I53b7b7a273152ed80b71f58c7b5d1c28c1e5c70c
---
M specials/SpecialGlobalUsers.php
1 file changed, 57 insertions(+), 1 deletion(-)

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



diff --git a/specials/SpecialGlobalUsers.php b/specials/SpecialGlobalUsers.php
index ca269ac..ae62e46 100644
--- a/specials/SpecialGlobalUsers.php
+++ b/specials/SpecialGlobalUsers.php
@@ -39,12 +39,13 @@
        }
 }
 
-class GlobalUsersPager extends UsersPager {
+class GlobalUsersPager extends AlphabeticPager {
        public $requestedGroup = false, $requestedUser;
        private $wikiSets = array();
 
        function __construct( IContextSource $context = null, $par = null ) {
                parent::__construct( $context );
+               $this->mDefaultDirection = $this->getRequest()->getBool( 'desc' 
);
                $this->mDb = CentralAuthUser::getCentralSlaveDB();
        }
 
@@ -154,6 +155,61 @@
        }
 
        /**
+        * @return string
+        */
+       function getPageHeader() {
+               global $wgScript;
+
+               list( $self ) = explode( '/', 
$this->getTitle()->getPrefixedDBkey() );
+
+               # Form tag
+               $out = Xml::openElement(
+                       'form',
+                       array( 'method' => 'get', 'action' => $wgScript, 'id' 
=> 'mw-listusers-form' )
+               ) .
+                       Xml::fieldset( $this->msg( 'listusers' )->text() ) .
+                       Html::hidden( 'title', $self );
+
+               # Username field
+               $out .= Xml::label( $this->msg( 'listusersfrom' )->text(), 
'offset' ) . ' ' .
+                       Html::input(
+                               'username',
+                               $this->requestedUser,
+                               'text',
+                               array(
+                                       'id' => 'offset',
+                                       'size' => 20,
+                                       'autofocus' => $this->requestedUser === 
''
+                               )
+                       ) . ' ';
+
+               # Group drop-down list
+               $out .= Xml::label( $this->msg( 'group' )->text(), 'group' ) . 
' ' .
+                       Xml::openElement( 'select', array( 'name' => 'group', 
'id' => 'group' ) ) .
+                       Xml::option( $this->msg( 'group-all' )->text(), '' );
+               foreach ( $this->getAllGroups() as $group => $groupText ) {
+                       $out .= Xml::option( $groupText, $group, $group == 
$this->requestedGroup );
+               }
+               $out .= Xml::closeElement( 'select' ) . '<br />';
+               # Descending sort checkbox
+               $out .= Xml::checkLabel(
+                       $this->msg( 'listusers-desc' )->text(),
+                       'desc',
+                       'desc',
+                       $this->mDefaultDirection
+               );
+               $out .= "<p />";
+
+               # Submit button and form bottom
+               $out .= Html::hidden( 'limit', $this->mLimit );
+               $out .= Xml::submitButton( $this->msg( 'allpagessubmit' 
)->text() );
+               $out .= Xml::closeElement( 'fieldset' ) .
+                       Xml::closeElement( 'form' );
+
+               return $out;
+       }
+
+       /**
         * @return String
         */
        function getBody() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I53b7b7a273152ed80b71f58c7b5d1c28c1e5c70c
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Zsaigol <zsai...@hotmail.com>
Gerrit-Reviewer: CSteipp <cste...@wikimedia.org>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Waldir <wal...@email.com>
Gerrit-Reviewer: Zsaigol <zsai...@hotmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to