class ActiveUsersPager extends UsersPager {
function __construct( $group = null ) {
- global $wgRequest;
+ global $wgRequest, $wgRCMaxAge;
+ $this->RCMaxAge = ceil( $wgRCMaxAge / ( 3600 * 24 ) ); // Constant
+
$un = $wgRequest->getText( 'username' );
$this->requestedUser = '';
if ( $un != '' ) {
}
function formatRow( $row ) {
+ global $wgLang;
$userName = $row->user_name;
$userPage = Title::makeTitle( NS_USER, $userName );
$name = $this->getSkin()->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
$list = array();
foreach( self::getGroups( $row->user_id ) as $group )
$list[] = self::buildGroupLink( $group );
- $groups = implode( ', ', $list );
+ $groups = $wgLang->commaList( $list );
$item = wfSpecialList( $name, $groups );
- $count = wfMsgExt( 'activeusers-count', array( 'parsemag' ), $row->recentedits, $userName );
+ $count = wfMsgExt( 'activeusers-count',
+ array( 'parsemag' ),
+ $wgLang->formatNum( $row->recentedits ),
+ $userName,
+ $wgLang->formatNum ( $this->RCMaxAge )
+ );
$blocked = $row->blocked ? ' ' . wfMsgExt( 'listusers-blocked', array( 'parsemag' ), $userName ) : '';
- return "<li>{$item} [{$count}]{$blocked}</li>";
+ return Html::rawElement( 'li', array(), "{$item} [{$count}]{$blocked}" );
}
function getPageHeader() {
global $wgScript, $wgRequest;
$self = $this->getTitle();
-
- # Form tag
- $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
- '<fieldset>' .
- Xml::element( 'legend', array(), wfMsg( 'activeusers' ) );
- $out .= Xml::hidden( 'title', $self->getPrefixedDBkey() );
-
- # Username field
- $out .= Xml::label( wfMsg( 'activeusers-from' ), 'offset' ) . ' ' .
- Xml::input( 'username', 20, $this->requestedUser, array( 'id' => 'offset' ) ) . ' ';
-
- # Submit button and form bottom
- if( $this->mLimit )
- $out .= Xml::hidden( 'limit', $this->mLimit );
- $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) );
-
- $out .= '</fieldset>' . Xml::closeElement( 'form' );
-
- return $out;
+ $limit = $this->mLimit ? Xml::hidden( 'limit', $this->mLimit ) : '';
+
+ return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . # Form tag
+ Xml::fieldset( wfMsg( 'activeusers' ) ) . "\n" .
+ Xml::hidden( 'title', $self->getPrefixedDBkey() ) .
+ $limit . "\n" .
+ Xml::inputLabel( wfMsg( 'activeusers-from' ), 'username', 'offset', 20, $this->requestedUser ) . ' ' . # Username field
+ Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .# Submit button and form bottom
+ Xml::closeElement( 'fieldset' ) .
+ Xml::closeElement( 'form' );
}
}
$s = $up->getPageHeader();
if( $usersbody ) {
$s .= $up->getNavigationBar();
- $s .= '<ul>' . $usersbody . '</ul>';
+ $s .= Html::rawElement( 'ul', array(), $usersbody );
$s .= $up->getNavigationBar();
} else {
- $s .= '<p>' . wfMsgHtml( 'activeusers-noresult' ) . '</p>';
+ $s .= Html::element( 'p', array(), wfMsg( 'activeusers-noresult' ) );
}
$wgOut->addHTML( $s );