Index: trunk/extensions/Translate/SpecialTranslationStats.php |
— | — | @@ -290,16 +290,12 @@ |
291 | 291 | if ( $opts['scale'] === 'hours' ) $increment = 3600; |
292 | 292 | |
293 | 293 | $labels = $so->labels(); |
294 | | - if ( count($labels) ) { |
295 | | - $keys = array_keys( $labels ); |
296 | | - $values = array_pad( array(), count( $labels ), 0 ); |
297 | | - $defaults = array_combine( $keys, $values ); |
298 | | - } else { |
299 | | - $defaults = array( '0' => '0' ); |
300 | | - } |
| 294 | + $keys = array_keys( $labels ); |
| 295 | + $values = array_pad( array(), count( $labels ), 0 ); |
| 296 | + $defaults = array_combine( $keys, $values ); |
301 | 297 | |
302 | 298 | $data = array(); |
303 | | - while ( $cutoff < $now ) { |
| 299 | + while ( $cutoff <= $now+$increment ) { |
304 | 300 | $date = $wgLang->sprintfDate( $dateFormat, wfTimestamp( TS_MW, $cutoff ) ); |
305 | 301 | $cutoff += $increment; |
306 | 302 | $data[$date] = $defaults; |
— | — | @@ -319,6 +315,11 @@ |
320 | 316 | } |
321 | 317 | } |
322 | 318 | |
| 319 | + // Don't display dummy label |
| 320 | + if ( count( $labels ) === 1 && $labels[0] === 'all' ) { |
| 321 | + $labels = array(); |
| 322 | + } |
| 323 | + |
323 | 324 | return array( $labels, $data ); |
324 | 325 | } |
325 | 326 | |
— | — | @@ -378,7 +379,6 @@ |
379 | 380 | |
380 | 381 | $plot->SetTransparentColor( 'white' ); |
381 | 382 | $plot->SetBackgroundColor( 'white' ); |
382 | | - // $plot->SetFileFormat('gif'); |
383 | 383 | |
384 | 384 | // Draw it |
385 | 385 | $plot->DrawGraph(); |
— | — | @@ -489,7 +489,7 @@ |
490 | 490 | } elseif ( $group || $code ) { |
491 | 491 | return "$group$code"; |
492 | 492 | } else { |
493 | | - return "Test"; |
| 493 | + return 'all'; |
494 | 494 | } |
495 | 495 | } |
496 | 496 | |