r53131 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53130‎ | r53131 | r53132 >
Date:12:10, 12 July 2009
Author:btongminh
Status:ok
Tags:
Comment:
(bug 17809) Add number of users in user groups to meta=siteinfo
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -72,7 +72,7 @@
7373 $fit = $this->appendStatistics( $p );
7474 break;
7575 case 'usergroups':
76 - $fit = $this->appendUserGroups( $p );
 76+ $fit = $this->appendUserGroups( $p, $params['numberingroup'] );
7777 break;
7878 case 'extensions':
7979 $fit = $this->appendExtensions( $p );
@@ -316,11 +316,17 @@
317317 return $this->getResult()->addValue( 'query', $property, $data );
318318 }
319319
320 - protected function appendUserGroups( $property ) {
 320+ protected function appendUserGroups( $property, $numberInGroup ) {
321321 global $wgGroupPermissions;
322322 $data = array();
323323 foreach( $wgGroupPermissions as $group => $permissions ) {
324 - $arr = array( 'name' => $group, 'rights' => array_keys( $permissions, true ) );
 324+ $arr = array(
 325+ 'name' => $group,
 326+ 'rights' => array_keys( $permissions, true ),
 327+ );
 328+ if ( $numberInGroup )
 329+ $arr['number'] = SiteStats::numberInGroup( $group );
 330+
325331 $this->getResult()->setIndexedTagName( $arr['rights'], 'permission' );
326332 $data[] = $arr;
327333 }
@@ -431,6 +437,7 @@
432438 )
433439 ),
434440 'showalldb' => false,
 441+ 'numberingroup' => false,
435442 );
436443 }
437444
@@ -454,6 +461,7 @@
455462 ),
456463 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
457464 'showalldb' => 'List all database servers, not just the one lagging the most',
 465+ 'numberingroup' => 'Lists the number of users in user groups',
458466 );
459467 }
460468
Index: trunk/phase3/RELEASE-NOTES
@@ -285,6 +285,7 @@
286286 * (bug 19423) The initial file description page used caption in user lang
287287 rather than UI lang
288288 * Added snippet field to list=search output
 289+* (bug 17809) Add number of users in user groups to meta=siteinfo
289290
290291 === Languages updated in 1.16 ===
291292

Status & tagging log