Index: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | $numbers = $this->getNumbers( $res ); |
42 | 42 | |
43 | 43 | if ( count( $numbers ) == 0 ) { |
44 | | - return ''; |
| 44 | + return $this->params['default']; |
45 | 45 | } |
46 | 46 | |
47 | 47 | switch ( $this->mFormat ) { |
— | — | @@ -122,6 +122,10 @@ |
123 | 123 | $params['limit'] = new Parameter( 'limit', Parameter::TYPE_INTEGER ); |
124 | 124 | $params['limit']->setMessage( 'srf_paramdesc_limit' ); |
125 | 125 | $params['limit']->setDefault( 1000 ); |
| 126 | + |
| 127 | + $params['default'] = new Parameter( 'default' ); |
| 128 | + $params['default']->setMessage( 'srf-paramdesc-default' ); |
| 129 | + $params['default']->setDefault( '' ); |
126 | 130 | |
127 | 131 | return $params; |
128 | 132 | } |
Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES |
— | — | @@ -9,7 +9,8 @@ |
10 | 10 | Semantic Result Formats 1.7.1 is currently in beta-quality and is not recommended for use in |
11 | 11 | production until the actual release. |
12 | 12 | |
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). |
14 | 15 | |
15 | 16 | New formats in this version are: |
16 | 17 | * JitGraph, still in alpha, disabled by default (written by Alex Shapovalov) (bug 32877) |
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php |
— | — | @@ -39,9 +39,9 @@ |
40 | 40 | 'srf_printername_outline' => 'Outline', |
41 | 41 | 'srf_paramdesc_outlineproperties' => 'The list of properties to be displayed as outline headers, separated by commas', |
42 | 42 | |
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', |
46 | 46 | |
47 | 47 | // format "math" |
48 | 48 | 'srf_printername_sum' => 'Sum of numbers', |
— | — | @@ -51,7 +51,8 @@ |
52 | 52 | 'srf_paramdesc_limit' => 'The maximum number of pages to query', |
53 | 53 | 'srf_printername_product' => 'Product of numbers', |
54 | 54 | 'srf_printername_median' => 'Median of numbers', |
55 | | - |
| 55 | + 'srf-paramdesc-default' => 'Default value that will be displayed when there are no numerical results', |
| 56 | + |
56 | 57 | // formats "timeline" and "eventline" |
57 | 58 | 'srf_printername_timeline' => 'Timeline', |
58 | 59 | 'srf_printername_eventline' => 'Eventline', |