Use proper nosuchuser msg (fix for r86482)
[lhc/web/wiklou.git] / includes / specials / SpecialActiveusers.php
index ded22da..e4bf42d 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * Copyright (C) 2008 Aaron Schulz
+ * Implements Special:Activeusers
+ *
+ * Copyright © 2008 Aaron Schulz
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,6 +18,9 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
  */
 
 /**
  * rights (sysop, bureaucrat, developer) will have them displayed
  * next to their names.
  *
- * @file
  * @ingroup SpecialPage
  */
 class ActiveUsersPager extends UsersPager {
 
+       /**
+        * @var FormOptions
+        */
+       protected $opts;
+
+       /**
+        * @var Array
+        */
+       protected $groups;
+
        function __construct( $group = null ) {
                global $wgRequest, $wgActiveUserDays;
                $this->RCMaxAge = $wgActiveUserDays;
@@ -39,15 +53,19 @@ class ActiveUsersPager extends UsersPager {
                                $this->requestedUser = $username->getText();
                        }
                }
-               
+
                $this->setupOptions();
-               
+
                parent::__construct();
        }
 
+       function getTitle() {
+               return SpecialPage::getTitleFor( 'Activeusers' );
+       }
+
        public function setupOptions() {
                global $wgRequest;
-               
+
                $this->opts = new FormOptions();
 
                $this->opts->add( 'hidebots', false, FormOptions::BOOL );
@@ -56,10 +74,12 @@ class ActiveUsersPager extends UsersPager {
                $this->opts->fetchValuesFromRequest( $wgRequest );
 
                $this->groups = array();
-               if ($this->opts->getValue('hidebots') == 1)
+               if ( $this->opts->getValue( 'hidebots' ) == 1 ) {
                        $this->groups['bot'] = true;
-               if ($this->opts->getValue('hidesysops') == 1)
+               }
+               if ( $this->opts->getValue( 'hidesysops' ) == 1 ) {
                        $this->groups['sysop'] = true;
+               }
        }
 
        function getIndexField() {
@@ -72,7 +92,7 @@ class ActiveUsersPager extends UsersPager {
                $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names
                $conds[] = "rc_log_type IS NULL OR rc_log_type != 'newusers'";
                $conds[] = "rc_timestamp >= '{$dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 )}'";
-               
+
                if( $this->requestedUser != '' ) {
                        $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser );
                }
@@ -101,14 +121,15 @@ class ActiveUsersPager extends UsersPager {
        function formatRow( $row ) {
                global $wgLang;
                $userName = $row->user_name;
-               
+
                $ulinks = $this->getSkin()->userLink( $row->user_id, $userName );
                $ulinks .= $this->getSkin()->userToolLinks( $row->user_id, $userName );
 
                $list = array();
                foreach( self::getGroups( $row->user_id ) as $group ) {
-                       if (isset($this->groups[$group]))
+                       if ( isset( $this->groups[$group] ) ) {
                                return;
+                       }
                        $list[] = self::buildGroupLink( $group );
                }
                $groups = $wgLang->commaList( $list );
@@ -129,11 +150,11 @@ class ActiveUsersPager extends UsersPager {
                global $wgScript;
 
                $self = $this->getTitle();
-               $limit = $this->mLimit ? Xml::hidden( 'limit', $this->mLimit ) : '';
+               $limit = $this->mLimit ? Html::hidden( 'limit', $this->mLimit ) : '';
 
-               $out  = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); # Form tag
+               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); # Form tag
                $out .= Xml::fieldset( wfMsg( 'activeusers' ) ) . "\n";
-               $out .= Xml::hidden( 'title', $self->getPrefixedDBkey() ) . $limit . "\n";
+               $out .= Html::hidden( 'title', $self->getPrefixedDBkey() ) . $limit . "\n";
 
                $out .= Xml::inputLabel( wfMsg( 'activeusers-from' ), 'username', 'offset', 20, $this->requestedUser ) . '<br />';# Username field
 
@@ -141,10 +162,10 @@ class ActiveUsersPager extends UsersPager {
 
                $out .= Xml::checkLabel( wfMsg('activeusers-hidesysops'), 'hidesysops', 'hidesysops', $this->opts->getValue( 'hidesysops' ) ) . '<br />';
 
-               $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .  "\n";# Submit button and form bottom
+               $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n";# Submit button and form bottom
                $out .= Xml::closeElement( 'fieldset' );
                $out .= Xml::closeElement( 'form' );
-               
+
                return $out;
        }
 }
@@ -157,7 +178,7 @@ class SpecialActiveUsers extends SpecialPage {
        /**
         * Constructor
         */
-       public function  __construct() {
+       public function __construct() {
                parent::__construct( 'Activeusers' );
        }