Index: trunk/extensions/phpbbData/phpbbData.php |
— | — | @@ -21,24 +21,18 @@ |
22 | 22 | 'url' => 'http://www.mediawiki.org/wiki/Extension:phpbbData', |
23 | 23 | ); |
24 | 24 | |
25 | | -$wgExtensionFunctions[] = 'efPhpbbData_Setup'; |
| 25 | +$wgHooks['ParserFirstCallInit'][] = 'efPhpbbData_ParserFirstCallInit'; |
26 | 26 | $wgHooks['LanguageGetMagic' ][] = 'efPhpbbData_LanguageGetMagic'; |
27 | 27 | $wgHooks['BeforePageDisplay'][] = 'efPhpbbData_BeforePageDisplay'; |
28 | 28 | |
29 | | -function efPhpbbData_Setup() { |
30 | | - global $wgParser, $wgMessageCache; |
31 | | - |
32 | | - #Add Messages |
33 | | - require( dirname( __FILE__ ) . '/phpbbData.i18n.php' ); |
34 | | - foreach( $messages as $key => $value ) { |
35 | | - $wgMessageCache->addMessages( $messages[$key], $key ); |
36 | | - } |
37 | | - |
38 | | - # Set a function hook associating the "example" magic word with our function |
39 | | - $wgParser->setFunctionHook( 'phpbb', 'efPhpbbData_RenderList' ); |
40 | | - $wgParser->setFunctionHook( 'phpbblink', 'efPhpbbData_RenderLink' ); |
41 | | - |
42 | | - return true; |
| 29 | +$wgExtensionMessagesFiles['phpbbData'] = dirname( __FILE__ ) . '/phpbbData.i18n.php'; |
| 30 | + |
| 31 | +function efPhpbbData_ParserFirstCallInit( $parser ) { |
| 32 | + # Set a function hook associating the "example" magic word with our function |
| 33 | + $parser->setFunctionHook( 'phpbb', 'efPhpbbData_RenderList' ); |
| 34 | + $parser->setFunctionHook( 'phpbblink', 'efPhpbbData_RenderLink' ); |
| 35 | + |
| 36 | + return true; |
43 | 37 | } |
44 | 38 | |
45 | 39 | function efPhpbbData_BeforePageDisplay(&$out) { |