From d7bd1ddb77bbbde18bddbd4209f92c286db55a7b Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 17 Nov 2008 17:38:30 +0000 Subject: [PATCH] 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. --- includes/specials/SpecialStatistics.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index fdd713ca02..cd4a9b2b84 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -117,9 +117,16 @@ function wfSpecialStatistics( $par = '' ) { array(), array( 'group' => $group ), 'known' ); + + # Add a class when a usergroup contains no members to allow hiding these rows + $classZero = ''; + $countUsers = SiteStats::numberingroup( $groupname ); + if( $countUsers == 0 ) { + $classZero = ' statistics-group-zero'; + } $text .= formatRow( $grouppage . ' ' . $grouplink, - $wgLang->formatNum( SiteStats::numberingroup( $groupname ) ), - ' class="statistics-group-' . Sanitizer::escapeClass( $group ) . '"' ); + $wgLang->formatNum( $countUsers ), + ' class="statistics-group-' . Sanitizer::escapeClass( $group ) . $classZero . '"' ); } } $text .= $viewsStats; -- 2.20.1