r84644 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84643‎ | r84644 | r84645 >
Date:22:35, 23 March 2011
Author:ialex
Status:deferred
Tags:
Comment:
And I forgot to commit this in r84631
Modified paths:
  • /trunk/extensions/SmoothGallery/SmoothGallery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SmoothGallery/SmoothGallery.php
@@ -41,7 +41,7 @@
4242 'url' => 'http://www.mediawiki.org/wiki/Extension:SmoothGallery',
4343 );
4444
45 -$wgExtensionFunctions[] = "efSmoothGallery";
 45+$wgHooks['ParserFirstCallInit'][] = 'efSmoothGallerySetHooks';
4646
4747 $wgHooks['OutputPageParserOutput'][] = 'smoothGalleryParserOutput';
4848
@@ -62,13 +62,12 @@
6363 $wgSmoothGalleryThumbHeight = "75px";
6464 $wgSmoothGalleryThumbWidth = "100px";
6565
66 -function efSmoothGallery() {
67 - global $wgParser;
 66+function efSmoothGallerySetHooks( $parser ) {
 67+ $parser->setHook( 'sgallery', 'initSmoothGalleryTag' );
 68+ $parser->setHook( 'sgalleryset', 'initSmoothGalleryTagSet' );
6869
69 - $wgParser->setHook( 'sgallery', 'initSmoothGalleryTag' );
70 - $wgParser->setHook( 'sgalleryset', 'initSmoothGalleryTagSet' );
71 -
72 - $wgParser->setFunctionHook( 'sgallery', 'initSmoothGalleryPF' );
 70+ $parser->setFunctionHook( 'sgallery', 'initSmoothGalleryPF' );
 71+ return true;
7372 }
7473
7574 // FIXME: split off to a hook file and use $wgHooks['ParserFirstCallInit'] to init tags

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84631* Changed extension functions registering parser hooks and tags to use Parser...ialex21:14, 23 March 2011

Status & tagging log