r39765 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39764‎ | r39765 | r39766 >
Date:13:32, 21 August 2008
Author:yaron
Status:old
Tags:
Comment:
Added support for $smwgResultFormats variable, introduced in SMW 1.2.2
Modified paths:
  • /trunk/extensions/SemanticGoogleMaps/SemanticGoogleMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticGoogleMaps/SemanticGoogleMaps.php
@@ -26,7 +26,7 @@
2727 // credits
2828 $wgExtensionCredits['parserhook'][] = array(
2929 'name' => 'Semantic Google Maps',
30 - 'version' => '0.3.3',
 30+ 'version' => '0.3.4',
3131 'author' => array( 'Robert Buzink', 'Yaron Koren' ),
3232 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Google_Maps',
3333 'description' => 'Allows users to add Google Maps to wiki pages based on structured data',
@@ -43,7 +43,13 @@
4444 }
4545
4646 include_once('SGM_QueryPrinter.php');
47 - SMWQueryProcessor::$formats['googlemap'] = 'SGMResultPrinter';
 47+ // global variable introduced in SMW 1.2.2
 48+ global $smwgResultFormats;
 49+ if (isset($smwgResultFormats))
 50+ $smwgResultFormats['googlemap'] = 'SGMResultPrinter';
 51+ else
 52+ SMWQueryProcessor::$formats['googlemap'] = 'SGMResultPrinter';
 53+
4854 }
4955
5056 function sgmFunctionMagic( &$magicWords, $langCode ) {

Status & tagging log