r54744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54743‎ | r54744 | r54745 >
Date:20:59, 10 August 2009
Author:catrope
Status:deferred
Tags:
Comment:
PrefStats: Make the number of bars in default scaling mode configurable, and raise the default from 10 to 15
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.php
@@ -47,6 +47,9 @@
4848 'prefstats-factor-default' => null,
4949 );
5050
 51+// How many bars to strive for in default scaling
 52+$wgPrefStatsDefaultScaleBars = 15;
 53+
5154 // Whether to run possibly expensive COUNT(*) queries on the user_properties
5255 // table
5356 $wgPrefStatsExpensiveCounts = false;
Index: trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php
@@ -126,10 +126,10 @@
127127 }
128128
129129 function getPrefStats( $pref, $inc = null ) {
130 - global $wgPrefStatsTimeUnit;
 130+ global $wgPrefStatsTimeUnit, $wgPrefStatsDefaultScaleBars;
131131 $max = ceil( $this->getMaxDuration( $pref ) /
132132 $wgPrefStatsTimeUnit );
133 - $inc = max( 1, ( is_null( $inc ) ? ceil( $max / 10 ) : $inc ) );
 133+ $inc = max( 1, ( is_null( $inc ) ? ceil( $max / $wgPrefStatsDefaultScaleBars ) : $inc ) );
134134 $retval = array();
135135 for ( $i = 0; $i <= $max; $i += $inc ) {
136136 $end = min( $max, $i + $inc );

Status & tagging log