Recommit r84805, but without removing UsersPager, which is actually a Good Thing...
authorHappy-melon <happy-melon@users.mediawiki.org>
Thu, 14 Apr 2011 13:27:50 +0000 (13:27 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Thu, 14 Apr 2011 13:27:50 +0000 (13:27 +0000)
includes/AutoLoader.php
includes/SpecialPage.php
includes/specials/SpecialListusers.php

index 54d62e8..79c1b57 100644 (file)
@@ -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',
index 5eea301..d497027 100644 (file)
@@ -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',
index 1566088..a667e69 100644 (file)
@@ -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 .=   '<ul>' . $usersbody . '</ul>';
-               $s .=   $up->getNavigationBar() ;
-       } else {
-               $s .=   '<p>' . wfMsgHTML('listusers-noresult') . '</p>';
-       };
-       $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 );
+       }
 }