$request = $this->getRequest();
$par = ( $par !== null ) ? $par : '';
$parms = explode( '/', $par );
- $symsForAll = array( '*', 'user' );
+ $symsForAll = [ '*', 'user' ];
if ( $parms[0] != '' &&
( in_array( $par, User::getAllGroups() ) || in_array( $par, $symsForAll ) )
*/
function getQueryInfo() {
$dbr = wfGetDB( DB_SLAVE );
- $conds = array();
+ $conds = [];
// Don't show hidden names
if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
$conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
}
- $options = array();
+ $options = [];
if ( $this->requestedGroup != '' ) {
$conds['ug_group'] = $this->requestedGroup;
$options['GROUP BY'] = $this->creationSort ? 'user_id' : 'user_name';
- $query = array(
- 'tables' => array( 'user', 'user_groups', 'ipblocks' ),
- 'fields' => array(
+ $query = [
+ 'tables' => [ 'user', 'user_groups', 'ipblocks' ],
+ 'fields' => [
'user_name' => $this->creationSort ? 'MAX(user_name)' : 'user_name',
'user_id' => $this->creationSort ? 'user_id' : 'MAX(user_id)',
'edits' => 'MAX(user_editcount)',
'creation' => 'MIN(user_registration)',
'ipb_deleted' => 'MAX(ipb_deleted)' // block/hide status
- ),
+ ],
'options' => $options,
- 'join_conds' => array(
- 'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ),
- 'ipblocks' => array(
- 'LEFT JOIN', array(
+ 'join_conds' => [
+ 'user_groups' => [ 'LEFT JOIN', 'user_id=ug_user' ],
+ 'ipblocks' => [
+ 'LEFT JOIN', [
'user_id=ipb_user',
'ipb_auto' => 0
- )
- ),
- ),
+ ]
+ ],
+ ],
'conds' => $conds
- );
+ ];
- Hooks::run( 'SpecialListusersQueryInfo', array( $this, &$query ) );
+ Hooks::run( 'SpecialListusersQueryInfo', [ $this, &$query ] );
return $query;
}
* @return string
*/
function formatRow( $row ) {
- if ( $row->user_id == 0 ) { #Bug 16487
+ if ( $row->user_id == 0 ) { # Bug 16487
return '';
}
$groups_list = self::getGroups( intval( $row->user_id ), $this->userGroupCache );
if ( !$this->including && count( $groups_list ) > 0 ) {
- $list = array();
+ $list = [];
foreach ( $groups_list as $group ) {
$list[] = self::buildGroupLink( $group, $userName );
}
' ' . $this->msg( 'listusers-blocked', $userName )->escaped() :
'';
- Hooks::run( 'SpecialListusersFormatRow', array( &$item, $row ) );
+ Hooks::run( 'SpecialListusersFormatRow', [ &$item, $row ] );
- return Html::rawElement( 'li', array(), "{$item}{$edits}{$created}{$blocked}" );
+ return Html::rawElement( 'li', [], "{$item}{$edits}{$created}{$blocked}" );
}
function doBatchLookups() {
$batch = new LinkBatch();
- $userIds = array();
+ $userIds = [];
# Give some pointers to make user links
foreach ( $this->mResult as $row ) {
$batch->add( NS_USER, $row->user_name );
$dbr = wfGetDB( DB_SLAVE );
$groupRes = $dbr->select(
'user_groups',
- array( 'ug_user', 'ug_group' ),
- array( 'ug_user' => $userIds ),
+ [ 'ug_user', 'ug_group' ],
+ [ 'ug_user' => $userIds ],
__METHOD__
);
- $cache = array();
- $groups = array();
+ $cache = [];
+ $groups = [];
foreach ( $groupRes as $row ) {
$cache[intval( $row->ug_user )][] = $row->ug_group;
$groups[$row->ug_group] = true;
# Form tag
$out = Xml::openElement(
'form',
- array( 'method' => 'get', 'action' => wfScript(), 'id' => 'mw-listusers-form' )
+ [ 'method' => 'get', 'action' => wfScript(), 'id' => 'mw-listusers-form' ]
) .
Xml::fieldset( $this->msg( 'listusers' )->text() ) .
Html::hidden( 'title', $self );
'username',
$this->requestedUser,
'text',
- array(
+ [
'class' => 'mw-autocomplete-user',
'id' => 'offset',
'size' => 20,
'autofocus' => $this->requestedUser === ''
- )
+ ]
) . ' ';
# Group drop-down list
);
$out .= '<br />';
- Hooks::run( 'SpecialListusersHeaderForm', array( $this, &$out ) );
+ Hooks::run( 'SpecialListusersHeaderForm', [ $this, &$out ] );
# Submit button and form bottom
$out .= Html::hidden( 'limit', $this->mLimit );
- $out .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() );
- Hooks::run( 'SpecialListusersHeader', array( $this, &$out ) );
+ $out .= Xml::submitButton( $this->msg( 'listusers-submit' )->text() );
+ Hooks::run( 'SpecialListusersHeader', [ $this, &$out ] );
$out .= Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );
* @return array
*/
function getAllGroups() {
- $result = array();
+ $result = [];
foreach ( User::getAllGroups() as $group ) {
$result[$group] = User::getGroupName( $group );
}
if ( $this->requestedUser != '' ) {
$query['username'] = $this->requestedUser;
}
- Hooks::run( 'SpecialListusersDefaultQuery', array( $this, &$query ) );
+ Hooks::run( 'SpecialListusersDefaultQuery', [ $this, &$query ] );
return $query;
}
$user = User::newFromId( $uid );
$effectiveGroups = $user->getEffectiveGroups();
} else {
- $effectiveGroups = isset( $cache[$uid] ) ? $cache[$uid] : array();
+ $effectiveGroups = isset( $cache[$uid] ) ? $cache[$uid] : [];
}
$groups = array_diff( $effectiveGroups, User::getImplicitGroups() );
* @return string
*/
protected static function buildGroupLink( $group, $username ) {
- return User::makeGroupLinkHtml(
+ return User::makeGroupLinkHTML(
$group,
User::getGroupMember( $group, $username )
);
if ( $usersbody ) {
$s .= $up->getNavigationBar();
- $s .= Html::rawElement( 'ul', array(), $usersbody );
+ $s .= Html::rawElement( 'ul', [], $usersbody );
$s .= $up->getNavigationBar();
} else {
$s .= $this->msg( 'listusers-noresult' )->parseAsBlock();