From: Raimond Spekking Date: Mon, 17 Nov 2008 17:38:30 +0000 (+0000) Subject: Add a class when a usergroup contains no members to allow hiding these rows per Commo... X-Git-Tag: 1.31.0-rc.0~44316 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d7bd1ddb77bbbde18bddbd4209f92c286db55a7b;p=lhc%2Fweb%2Fwiklou.git 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. --- 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;