https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113065

Revision: 113065
Author:   jeroendedauw
Date:     2012-03-05 19:22:27 +0000 (Mon, 05 Mar 2012)
Log Message:
-----------
bug 34983

Modified Paths:
--------------
    trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
    trunk/extensions/SemanticResultFormats/RELEASE-NOTES
    trunk/extensions/SemanticResultFormats/SRF_Messages.php

Modified: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
===================================================================
--- trunk/extensions/SemanticResultFormats/Math/SRF_Math.php    2012-03-05 
19:17:55 UTC (rev 113064)
+++ trunk/extensions/SemanticResultFormats/Math/SRF_Math.php    2012-03-05 
19:22:27 UTC (rev 113065)
@@ -40,7 +40,7 @@
                $numbers = $this->getNumbers( $res );
                
                if ( count( $numbers ) == 0 ) {
-                       return '';
+                       return $this->params['default'];
                }
                
                switch ( $this->mFormat ) {
@@ -122,6 +122,10 @@
                $params['limit'] = new Parameter( 'limit', 
Parameter::TYPE_INTEGER );
                $params['limit']->setMessage( 'srf_paramdesc_limit' );
                $params['limit']->setDefault( 1000 );
+
+               $params['default'] = new Parameter( 'default' );
+               $params['default']->setMessage( 'srf-paramdesc-default' );
+               $params['default']->setDefault( '' );
                
                return $params;
        }

Modified: trunk/extensions/SemanticResultFormats/RELEASE-NOTES
===================================================================
--- trunk/extensions/SemanticResultFormats/RELEASE-NOTES        2012-03-05 
19:17:55 UTC (rev 113064)
+++ trunk/extensions/SemanticResultFormats/RELEASE-NOTES        2012-03-05 
19:22:27 UTC (rev 113065)
@@ -9,7 +9,8 @@
 Semantic Result Formats 1.7.1 is currently in beta-quality and is not 
recommended for use in
 production until the actual release.
 
-* Fixed issue with the graphlenegd parameter in the graph format (bug 33745)
+* Fixed issue with the graphlenegd parameter in the graph format (bug 33745).
+* Added 'default' parameter to math formats (bug 34983).
 
 New formats in this version are:
 * JitGraph, still in alpha, disabled by default (written by Alex Shapovalov) 
(bug 32877)

Modified: trunk/extensions/SemanticResultFormats/SRF_Messages.php
===================================================================
--- trunk/extensions/SemanticResultFormats/SRF_Messages.php     2012-03-05 
19:17:55 UTC (rev 113064)
+++ trunk/extensions/SemanticResultFormats/SRF_Messages.php     2012-03-05 
19:22:27 UTC (rev 113065)
@@ -39,9 +39,9 @@
        'srf_printername_outline' => 'Outline',
        'srf_paramdesc_outlineproperties' => 'The list of properties to be 
displayed as outline headers, separated by commas',
        
-       'srf_printername_D3Line'  => 'D3 line chart',
-       'srf_printername_D3Bar'  => 'D3 bar chart',    
-       'srf_printername_D3Treemap'  => 'D3 treemap',     
+       'srf_printername_D3Line' => 'D3 line chart',
+       'srf_printername_D3Bar' => 'D3 bar chart',
+       'srf_printername_D3Treemap' => 'D3 treemap',
 
        // format "math"
        'srf_printername_sum' => 'Sum of numbers',
@@ -51,7 +51,8 @@
        'srf_paramdesc_limit' => 'The maximum number of pages to query',
        'srf_printername_product' => 'Product of numbers',
        'srf_printername_median' => 'Median of numbers',
-       
+       'srf-paramdesc-default' => 'Default value that will be displayed when 
there are no numerical results',
+
        // formats "timeline" and "eventline"
        'srf_printername_timeline' => 'Timeline',
        'srf_printername_eventline' => 'Eventline',


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to