From 95ec069a720fc6c12b5d0348b21414f693db6659 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 22 Sep 2008 11:54:10 +0000 Subject: [PATCH] * Add loadAllMessages, neede for usergroups definded in extensions * Add CSS classes per row to allow better customizations --- includes/specials/SpecialStatistics.php | 35 +++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index 6edc0445ef..fa81fca3c5 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -14,8 +14,9 @@ * @param mixed $par (not used) */ function wfSpecialStatistics( $par = '' ) { - global $wgOut, $wgLang, $wgRequest, $wgUser, $wgContLang; + global $wgOut, $wgLang, $wgRequest, $wgUser, $wgContLang, $wgMessageCache; global $wgDisableCounters, $wgMiserMode, $wgImplicitGroups, $wgGroupPermissions; + $wgMessageCache->loadAllMessages(); $sk = $wgUser->getSkin(); $dbr = wfGetDB( DB_SLAVE ); @@ -34,9 +35,11 @@ function wfSpecialStatistics( $par = '' ) { if( !$wgDisableCounters ) { $viewsStats = Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-views' ) ) . formatRow( wfMsgExt( 'statistics-views-total', array( 'parseinline' ) ), - $wgLang->formatNum( $views ) ) . + $wgLang->formatNum( $views ), + ' class="mw-statistics-views-total"' ) . formatRow( wfMsgExt( 'statistics-views-peredit', array( 'parseinline' ) ), - $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ) ); + $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ), + ' class="mw-statistics-views-peredit"' ); } # Set active user count if( !$wgMiserMode ) { @@ -57,27 +60,37 @@ function wfSpecialStatistics( $par = '' ) { # Statistic - pages Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-pages' ) ) . formatRow( wfMsgExt( 'statistics-articles', array( 'parseinline' ) ), - $wgLang->formatNum( $good ) ) . + $wgLang->formatNum( $good ), + ' class="mw-statistics-articles"' ) . formatRow( wfMsgExt( 'statistics-pages', array( 'parseinline' ) ), - $wgLang->formatNum( $total ), NULL, 'statistics-pages-tooltip' ) . + $wgLang->formatNum( $total ), + ' class="mw-statistics-pages"', + 'statistics-pages-tooltip' ) . formatRow( wfMsgExt( 'statistics-files', array( 'parseinline' ) ), - $wgLang->formatNum( $images ) ) . + $wgLang->formatNum( $images ), + ' class="mw-statistics-files"' ) . # Statistic - edits Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-edits' ) ) . formatRow( wfMsgExt( 'statistics-edits', array( 'parseinline' ) ), - $wgLang->formatNum( $edits ) ) . + $wgLang->formatNum( $edits ), + ' class="mw-statistics-edits"' ) . formatRow( wfMsgExt( 'statistics-edits-average', array( 'parseinline' ) ), - $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ) ) . + $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ), + ' class="mw-statistics-edits-average"' ) . formatRow( wfMsgExt( 'statistics-jobqueue', array( 'parseinline' ) ), - $wgLang->formatNum( $numJobs ) ) . + $wgLang->formatNum( $numJobs ), + ' class="mw-statistics-jobqueue"' ) . # Statistic - users Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-users' ) ) . formatRow( wfMsgExt( 'statistics-users', array( 'parseinline' ) ), - $wgLang->formatNum( $users ) ) . + $wgLang->formatNum( $users ), + ' class="mw-statistics-users"' ) . formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ), - $wgLang->formatNum( $activeUsers ), NULL, 'statistics-users-active-tooltip' ); + $wgLang->formatNum( $activeUsers ), + ' class="mw-statistics-users-active"', + 'statistics-users-active-tooltip' ); # Statistic - usergroups foreach( $wgGroupPermissions as $group => $permissions ) { -- 2.20.1