r113065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113064‎ | r113065 | r113066 >
Date:19:22, 5 March 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Math/SRF_Math.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SRF_Messages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
@@ -40,7 +40,7 @@
4141 $numbers = $this->getNumbers( $res );
4242
4343 if ( count( $numbers ) == 0 ) {
44 - return '';
 44+ return $this->params['default'];
4545 }
4646
4747 switch ( $this->mFormat ) {
@@ -122,6 +122,10 @@
123123 $params['limit'] = new Parameter( 'limit', Parameter::TYPE_INTEGER );
124124 $params['limit']->setMessage( 'srf_paramdesc_limit' );
125125 $params['limit']->setDefault( 1000 );
 126+
 127+ $params['default'] = new Parameter( 'default' );
 128+ $params['default']->setMessage( 'srf-paramdesc-default' );
 129+ $params['default']->setDefault( '' );
126130
127131 return $params;
128132 }
Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES
@@ -9,7 +9,8 @@
1010 Semantic Result Formats 1.7.1 is currently in beta-quality and is not recommended for use in
1111 production until the actual release.
1212
13 -* Fixed issue with the graphlenegd parameter in the graph format (bug 33745)
 13+* Fixed issue with the graphlenegd parameter in the graph format (bug 33745).
 14+* Added 'default' parameter to math formats (bug 34983).
1415
1516 New formats in this version are:
1617 * JitGraph, still in alpha, disabled by default (written by Alex Shapovalov) (bug 32877)
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php
@@ -39,9 +39,9 @@
4040 'srf_printername_outline' => 'Outline',
4141 'srf_paramdesc_outlineproperties' => 'The list of properties to be displayed as outline headers, separated by commas',
4242
43 - 'srf_printername_D3Line' => 'D3 line chart',
44 - 'srf_printername_D3Bar' => 'D3 bar chart',
45 - 'srf_printername_D3Treemap' => 'D3 treemap',
 43+ 'srf_printername_D3Line' => 'D3 line chart',
 44+ 'srf_printername_D3Bar' => 'D3 bar chart',
 45+ 'srf_printername_D3Treemap' => 'D3 treemap',
4646
4747 // format "math"
4848 'srf_printername_sum' => 'Sum of numbers',
@@ -51,7 +51,8 @@
5252 'srf_paramdesc_limit' => 'The maximum number of pages to query',
5353 'srf_printername_product' => 'Product of numbers',
5454 'srf_printername_median' => 'Median of numbers',
55 -
 55+ 'srf-paramdesc-default' => 'Default value that will be displayed when there are no numerical results',
 56+
5657 // formats "timeline" and "eventline"
5758 'srf_printername_timeline' => 'Timeline',
5859 'srf_printername_eventline' => 'Eventline',