r51995 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51994‎ | r51995 | r51996 >
Date:19:09, 16 June 2009
Author:catrope
Status:deferred
Tags:
Comment:
PrefStats: Remove the prefstats-stat-line message and document some $wg vars
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php
@@ -17,7 +17,6 @@
1818 'prefstats-title' => 'Preference statistics',
1919 'prefstats-list-intro' => 'Currently, the following preferences are being tracked. Click on one to view statistics about it.',
2020 'prefstats-list-elem' => '$1 = $2',
21 - 'prefstats-stat-line' => '$1 users have had the preference enabled for between $2 and $3 seconds',
2221 );
2322
2423 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.php
@@ -25,8 +25,10 @@
2626 // Tracking multiple values of the same preference is not possible
2727 $wgPrefStatsTrackPrefs = array();
2828
 29+// Dimensions of the chart on Special:PrefStats
2930 $wgPrefStatsChartDimensions = '1000x300';
3031
 32+// Time unit to use for the graph on Special:PrefStats
3133 $wgPrefStatsTimeUnit = 60*60*24; // one day
3234
3335 /* Setup */
Index: trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php
@@ -47,18 +47,10 @@
4848 }
4949
5050 function displayPrefStats( $pref ) {
51 - global $wgOut, $wgUser, $wgRequest, $wgPrefStatsTrackPrefs;
 51+ global $wgOut, $wgRequest, $wgPrefStatsTrackPrefs;
5252 $max = $this->getMaxDuration( $pref );
53 - $wgOut->addHTML( Xml::openElement( 'ul' ) );
5453 $stats = $this->getPrefStats( $pref,
5554 $wgRequest->getIntOrNull( 'inc' ) );
56 - foreach ( $stats as $key => $val ) {
57 - list( $from, $to ) = explode( '-', $key );
58 - $wgOut->addHTML( Xml::element( 'li', array(),
59 - wfMsg( 'prefstats-stat-line', $val, $from, $to )
60 - ) );
61 - }
62 - $wgOut->addHTML( Xml::closeElement( 'ul' ) );
6355 $wgOut->addHTML( Xml::element( 'img', array( 'src' =>
6456 $this->getGoogleChartParams( $stats ) ) ) );
6557 }

Status & tagging log