r43612 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43611‎ | r43612 | r43613 >
Date:17:38, 17 November 2008
Author:raymond
Status:ok
Tags:
Comment:
Add a class when a usergroup contains no members to allow hiding these rows per Commons.css or user specific CSS. Per suggestion of Purodha.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialStatistics.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialStatistics.php
@@ -117,9 +117,16 @@
118118 array(),
119119 array( 'group' => $group ),
120120 'known' );
 121+
 122+ # Add a class when a usergroup contains no members to allow hiding these rows
 123+ $classZero = '';
 124+ $countUsers = SiteStats::numberingroup( $groupname );
 125+ if( $countUsers == 0 ) {
 126+ $classZero = ' statistics-group-zero';
 127+ }
121128 $text .= formatRow( $grouppage . ' ' . $grouplink,
122 - $wgLang->formatNum( SiteStats::numberingroup( $groupname ) ),
123 - ' class="statistics-group-' . Sanitizer::escapeClass( $group ) . '"' );
 129+ $wgLang->formatNum( $countUsers ),
 130+ ' class="statistics-group-' . Sanitizer::escapeClass( $group ) . $classZero . '"' );
124131 }
125132 }
126133 $text .= $viewsStats;

Status & tagging log