'MAX(ug_group) AS singlegroup'),
'options' => array('GROUP BY' => 'user_name'),
'conds' => $conds
- );
-
+ );
+
}
function formatRow( $row ) {
$userPage = Title::makeTitle( NS_USER, $row->user_name );
$name = $this->getSkin()->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
-
+
if( $row->numgroups > 1 || ( $this->requestedGroup && $row->numgroups == 1 ) ) {
$list = array();
foreach( self::getGroups( $row->user_id ) as $group )
} else {
$groups = '';
}
-
+
return '<li>' . wfSpecialList( $name, $groups ) . '</li>';
}
$this->doQuery();
}
$batch = new LinkBatch;
- $db = $this->mDb;
$this->mResult->rewind();
}
function getPageHeader( ) {
- global $wgRequest;
+ global $wgScript, $wgRequest;
$self = $this->getTitle();
# Form tag
- $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $self->getLocalUrl() ) ) .
+ $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
'<fieldset>' .
Xml::element( 'legend', array(), wfMsg( 'listusers' ) );
+ $out .= Xml::hidden( 'title', $self->getPrefixedDbKey() );
# Username field
$out .= Xml::label( wfMsg( 'listusersfrom' ), 'offset' ) . ' ' .
Xml::input( 'username', 20, $this->requestedUser, array( 'id' => 'offset' ) ) . ' ';
- if( $this->mLimit )
- $out .= Xml::hidden( 'limit', $this->mLimit );
-
# Group drop-down list
$out .= Xml::label( wfMsg( 'group' ), 'group' ) . ' ' .
Xml::openElement('select', array( 'name' => 'group', 'id' => 'group' ) ) .
- Xml::option( wfMsg( 'group-all' ), '' ); # Item for "all groups"
-
- $groups = User::getAllGroups();
- foreach( $groups as $group ) {
- $attribs = array( 'value' => $group );
- $attribs['selected'] = ( $group == $this->requestedGroup ) ? 'selected' : '';
- $out .= Xml::option( User::getGroupName( $group ), $attribs['value'], $attribs['selected'] );
- }
+ Xml::option( wfMsg( 'group-all' ), '' );
+ foreach( User::getAllGroups() as $group )
+ $out .= Xml::option( User::getGroupName( $group ), $group, $group == $this->requestedGroup );
$out .= Xml::closeElement( 'select' ) . ' ';
# Submit button and form bottom
+ if( $this->mLimit )
+ $out .= Xml::hidden( 'limit', $this->mLimit );
$out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
'</fieldset>' .
Xml::closeElement( 'form' );
$query['username'] = $this->requestedUser;
return $query;
}
-
+
/**
* Get a list of groups the specified user belongs to
*
$dbr->freeResult( $res );
}
return $groups;
- }
-
+ }
+
/**
* Format a link to a group description page
*
$cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
return $cache[$group];
}
-
}
/**
function wfSpecialListusers( $par = null ) {
global $wgRequest, $wgOut;
- list( $limit, $offset ) = wfCheckLimits();
-
- $groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );
-
$up = new UsersPager($par);
# getBody() first to check, if empty
} else {
$s .= '<p>' . wfMsgHTML('listusers-noresult') . '</p>';
};
- $wgOut->addHTML( $s );
+
+ $wgOut->addHTML( $s );
}
-?>
+