http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97737

Revision: 97737
Author:   jeroendedauw
Date:     2011-09-21 14:35:22 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
fixed compat w/ SMW 1.6.2 and later

Modified Paths:
--------------
    trunk/extensions/SemanticDrilldown/SemanticDrilldown.php
    trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php

Modified: trunk/extensions/SemanticDrilldown/SemanticDrilldown.php
===================================================================
--- trunk/extensions/SemanticDrilldown/SemanticDrilldown.php    2011-09-21 
14:35:11 UTC (rev 97736)
+++ trunk/extensions/SemanticDrilldown/SemanticDrilldown.php    2011-09-21 
14:35:22 UTC (rev 97737)
@@ -13,7 +13,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) die();
 
-define( 'SD_VERSION', '0.8.3' );
+define( 'SD_VERSION', '0.8.4 alpha' );
 
 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 
'specialpage'][] = array(
        'path'        => __FILE__,

Modified: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
===================================================================
--- trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php       
2011-09-21 14:35:11 UTC (rev 97736)
+++ trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php       
2011-09-21 14:35:22 UTC (rev 97737)
@@ -1058,24 +1058,30 @@
                } else {
                        $query = new SMWQuery();
                }
-               if ( array_key_exists( 'format', $params ) ) {
-                       $format = $params['format'];
-               } else {
-                       $format = 'category';
+               if ( !array_key_exists( 'format', $params ) ) {
+                       $params['format'] = 'category';
                }
+               
                if ( array_key_exists( 'mainlabel', $params ) ) {
                        $mainlabel = $params['mainlabel'];
                } else {
                        $mainlabel = '';
                }
+               
                $r = $this->addSemanticResultWrapper( $dbr, $res, $num, $query, 
$mainlabel, $printouts );
-               $printer = SMWQueryProcessor::getResultPrinter( $format, 
SMWQueryProcessor::SPECIAL_PAGE, $r );
+               $printer = SMWQueryProcessor::getResultPrinter( 
$params['format'], SMWQueryProcessor::SPECIAL_PAGE, $r );
 
-               $prresult = $printer->getResult( $r, $params, SMW_OUTPUT_HTML );
-               if ( is_array( $prresult ) )
-                       $prtext = $prresult[0];
-               else
-                       $prtext = $prresult;
+               if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
+                       $params = SMWQueryProcessor::getProcessedParams( 
$params );
+               }
+               
+               $prresult = $printer->getResult(
+                       $r,
+                       $params,
+                       SMW_OUTPUT_HTML
+               );
+               
+               $prtext = is_array( $prresult ) ? $prresult[0] : $prresult;  
 
                SMWOutputs::commitToOutputPage( $out );
                


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

Reply via email to