Index: trunk/extensions/SmoothGallery/SmoothGallery.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | 'url' => 'http://www.mediawiki.org/wiki/Extension:SmoothGallery', |
43 | 43 | ); |
44 | 44 | |
45 | | -$wgExtensionFunctions[] = "efSmoothGallery"; |
| 45 | +$wgHooks['ParserFirstCallInit'][] = 'efSmoothGallerySetHooks'; |
46 | 46 | |
47 | 47 | $wgHooks['OutputPageParserOutput'][] = 'smoothGalleryParserOutput'; |
48 | 48 | |
— | — | @@ -62,13 +62,12 @@ |
63 | 63 | $wgSmoothGalleryThumbHeight = "75px"; |
64 | 64 | $wgSmoothGalleryThumbWidth = "100px"; |
65 | 65 | |
66 | | -function efSmoothGallery() { |
67 | | - global $wgParser; |
| 66 | +function efSmoothGallerySetHooks( $parser ) { |
| 67 | + $parser->setHook( 'sgallery', 'initSmoothGalleryTag' ); |
| 68 | + $parser->setHook( 'sgalleryset', 'initSmoothGalleryTagSet' ); |
68 | 69 | |
69 | | - $wgParser->setHook( 'sgallery', 'initSmoothGalleryTag' ); |
70 | | - $wgParser->setHook( 'sgalleryset', 'initSmoothGalleryTagSet' ); |
71 | | - |
72 | | - $wgParser->setFunctionHook( 'sgallery', 'initSmoothGalleryPF' ); |
| 70 | + $parser->setFunctionHook( 'sgallery', 'initSmoothGalleryPF' ); |
| 71 | + return true; |
73 | 72 | } |
74 | 73 | |
75 | 74 | // FIXME: split off to a hook file and use $wgHooks['ParserFirstCallInit'] to init tags |