From 9e85c48612102d244bb0c08f80966d3495a37172 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Thu, 14 Apr 2011 13:27:50 +0000 Subject: [PATCH] Recommit r84805, but without removing UsersPager, which is actually a Good Thing to use for this class of queries. Yay for the end of global-function-based special pages in core. About fifteen left in extensions now... --- includes/AutoLoader.php | 1 + includes/SpecialPage.php | 2 +- includes/specials/SpecialListusers.php | 57 +++++++++++++++++--------- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 54d62e86d6..79c1b571d9 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -690,6 +690,7 @@ $wgAutoloadLocalClasses = array( 'SpecialImport' => 'includes/specials/SpecialImport.php', 'SpecialListFiles' => 'includes/specials/SpecialListfiles.php', 'SpecialListGroupRights' => 'includes/specials/SpecialListgrouprights.php', + 'SpecialListUsers' => 'includes/specials/SpecialListusers.php', 'SpecialLockdb' => 'includes/specials/SpecialLockdb.php', 'SpecialLog' => 'includes/specials/SpecialLog.php', 'SpecialMergeHistory' => 'includes/specials/SpecialMergeHistory.php', diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 5eea301ca4..d497027a8c 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -134,7 +134,7 @@ class SpecialPage { 'Preferences' => 'SpecialPreferences', 'Contributions' => 'SpecialContributions', 'Listgrouprights' => 'SpecialListGroupRights', - 'Listusers' => array( 'SpecialPage', 'Listusers' ), + 'Listusers' => 'SpecialListUsers' , 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ), 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ), 'Activeusers' => 'SpecialActiveUsers', diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 15660886b2..a667e69994 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -272,25 +272,42 @@ class UsersPager extends AlphabeticPager { } /** - * constructor - * $par string (optional) A group to list users from + * @ingroup SpecialPage */ -function wfSpecialListusers( $par = null ) { - global $wgOut; - - $up = new UsersPager($par); - - # getBody() first to check, if empty - $usersbody = $up->getBody(); - $s = Xml::openElement( 'div', array('class' => 'mw-spcontent') ); - $s .= $up->getPageHeader(); - if( $usersbody ) { - $s .= $up->getNavigationBar(); - $s .= ''; - $s .= $up->getNavigationBar() ; - } else { - $s .= '

' . wfMsgHTML('listusers-noresult') . '

'; - }; - $s .= Xml::closeElement( 'div' ); - $wgOut->addHTML( $s ); +class SpecialListUsers extends SpecialPage { + + /** + * Constructor + */ + public function __construct() { + parent::__construct( 'Listusers' ); + } + + /** + * Show the special page + * + * @param $par string (optional) A group to list users from + */ + public function execute( $par ) { + global $wgOut; + + $this->setHeaders(); + $this->outputHeader(); + + $up = new UsersPager( $par ); + + # getBody() first to check, if empty + $usersbody = $up->getBody(); + + $s = $up->getPageHeader(); + if( $usersbody ) { + $s .= $up->getNavigationBar(); + $s .= Html::rawElement( 'ul', array(), $usersbody ); + $s .= $up->getNavigationBar(); + } else { + $s .= wfMessage( 'listusers-noresult' )->parseBlock(); + } + + $wgOut->addHTML( $s ); + } } -- 2.20.1