r41146 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41145‎ | r41146 | r41147 >
Date:11:54, 22 September 2008
Author:raymond
Status:old
Tags:
Comment:
* Add loadAllMessages, neede for usergroups definded in extensions
* Add CSS classes per row to allow better customizations
Modified paths:
  • /trunk/phase3/includes/specials/SpecialStatistics.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialStatistics.php
@@ -14,8 +14,9 @@
1515 * @param mixed $par (not used)
1616 */
1717 function wfSpecialStatistics( $par = '' ) {
18 - global $wgOut, $wgLang, $wgRequest, $wgUser, $wgContLang;
 18+ global $wgOut, $wgLang, $wgRequest, $wgUser, $wgContLang, $wgMessageCache;
1919 global $wgDisableCounters, $wgMiserMode, $wgImplicitGroups, $wgGroupPermissions;
 20+ $wgMessageCache->loadAllMessages();
2021 $sk = $wgUser->getSkin();
2122 $dbr = wfGetDB( DB_SLAVE );
2223
@@ -34,9 +35,11 @@
3536 if( !$wgDisableCounters ) {
3637 $viewsStats = Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-views' ) ) .
3738 formatRow( wfMsgExt( 'statistics-views-total', array( 'parseinline' ) ),
38 - $wgLang->formatNum( $views ) ) .
 39+ $wgLang->formatNum( $views ),
 40+ ' class="mw-statistics-views-total"' ) .
3941 formatRow( wfMsgExt( 'statistics-views-peredit', array( 'parseinline' ) ),
40 - $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ) );
 42+ $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ),
 43+ ' class="mw-statistics-views-peredit"' );
4144 }
4245 # Set active user count
4346 if( !$wgMiserMode ) {
@@ -57,27 +60,37 @@
5861 # Statistic - pages
5962 Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-pages' ) ) .
6063 formatRow( wfMsgExt( 'statistics-articles', array( 'parseinline' ) ),
61 - $wgLang->formatNum( $good ) ) .
 64+ $wgLang->formatNum( $good ),
 65+ ' class="mw-statistics-articles"' ) .
6266 formatRow( wfMsgExt( 'statistics-pages', array( 'parseinline' ) ),
63 - $wgLang->formatNum( $total ), NULL, 'statistics-pages-tooltip' ) .
 67+ $wgLang->formatNum( $total ),
 68+ ' class="mw-statistics-pages"',
 69+ 'statistics-pages-tooltip' ) .
6470 formatRow( wfMsgExt( 'statistics-files', array( 'parseinline' ) ),
65 - $wgLang->formatNum( $images ) ) .
 71+ $wgLang->formatNum( $images ),
 72+ ' class="mw-statistics-files"' ) .
6673
6774 # Statistic - edits
6875 Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-edits' ) ) .
6976 formatRow( wfMsgExt( 'statistics-edits', array( 'parseinline' ) ),
70 - $wgLang->formatNum( $edits ) ) .
 77+ $wgLang->formatNum( $edits ),
 78+ ' class="mw-statistics-edits"' ) .
7179 formatRow( wfMsgExt( 'statistics-edits-average', array( 'parseinline' ) ),
72 - $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ) ) .
 80+ $wgLang->formatNum( sprintf( '%.2f', $total ? $edits / $total : 0 ) ),
 81+ ' class="mw-statistics-edits-average"' ) .
7382 formatRow( wfMsgExt( 'statistics-jobqueue', array( 'parseinline' ) ),
74 - $wgLang->formatNum( $numJobs ) ) .
 83+ $wgLang->formatNum( $numJobs ),
 84+ ' class="mw-statistics-jobqueue"' ) .
7585
7686 # Statistic - users
7787 Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-users' ) ) .
7888 formatRow( wfMsgExt( 'statistics-users', array( 'parseinline' ) ),
79 - $wgLang->formatNum( $users ) ) .
 89+ $wgLang->formatNum( $users ),
 90+ ' class="mw-statistics-users"' ) .
8091 formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ),
81 - $wgLang->formatNum( $activeUsers ), NULL, 'statistics-users-active-tooltip' );
 92+ $wgLang->formatNum( $activeUsers ),
 93+ ' class="mw-statistics-users-active"',
 94+ 'statistics-users-active-tooltip' );
8295
8396 # Statistic - usergroups
8497 foreach( $wgGroupPermissions as $group => $permissions ) {