r57348 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57347‎ | r57348 | r57349 >
Date:23:02, 3 October 2009
Author:laner
Status:deferred
Tags:
Comment:
Fix backwards compatability with MediaWiki less than 1.16alpha
Modified paths:
  • /trunk/extensions/SmoothGallery/SmoothGallery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SmoothGallery/SmoothGallery.php
@@ -35,7 +35,7 @@
3636 $wgExtensionCredits['other'][] = array(
3737 'path' => __FILE__,
3838 'name' => 'SmoothGallery parser extension',
39 - 'version' => '1.1f',
 39+ 'version' => '1.1g',
4040 'author' => 'Ryan Lane',
4141 'description' => 'Allows users to create galleries with images that have been uploaded. Allows most options of SmoothGallery',
4242 'descriptionmsg' => 'smoothgallery-desc',
@@ -48,7 +48,11 @@
4949
5050 $dir = dirname( __FILE__ ) . '/';
5151 $wgExtensionMessagesFiles['SmoothGallery'] = $dir . 'SmoothGallery.i18n.php';
52 -$wgExtensionMessagesFiles['SmoothGalleryMagic'] = $dir . 'SmoothGallery.i18n.magic.php';
 52+if( version_compare( $wgVersion, '1.16alpha', '>=' ) ) {
 53+ $wgExtensionMessagesFiles['SmoothGalleryMagic'] = $dir . 'SmoothGallery.i18n.magic.php';
 54+} else {
 55+ $wgHooks['LanguageGetMagic'][] = 'smoothGalleryLanguageGetMagic';
 56+}
5357 $wgAutoloadClasses['SmoothGallery'] = $dir . 'SmoothGalleryClass.php';
5458 $wgAutoloadClasses['SmoothGalleryParser'] = $dir . 'SmoothGalleryParser.php';
5559
@@ -142,3 +146,12 @@
143147 }
144148 return true;
145149 }
 150+
 151+/**
 152+ * We ignore langCode - parser function names can be translated but
 153+ * we are not using this feature
 154+ */
 155+function smoothGalleryLanguageGetMagic( &$magicWords, $langCode ) {
 156+ $magicWords['sgallery'] = array( 0, 'sgallery' );
 157+ return true;
 158+}

Status & tagging log