Index: trunk/extensions/LabeledSectionTransclusion/lst.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | # Standard initialisation code |
23 | 23 | ## |
24 | 24 | |
25 | | -$wgExtensionFunctions[] = array( 'LabeledSectionTransclusion', "setup" ); |
| 25 | +$wgHooks['ParserFirstCallInit'][] = 'LabeledSectionTransclusion::setup'; |
26 | 26 | $wgHooks['LanguageGetMagic'][] = 'LabeledSectionTransclusion::setupMagic'; |
27 | 27 | |
28 | 28 | $wgExtensionCredits['parserhook'][] = array( |
— | — | @@ -40,17 +40,15 @@ |
41 | 41 | |
42 | 42 | class LabeledSectionTransclusion { |
43 | 43 | |
44 | | - static function setup() |
| 44 | + static function setup( $parser ) |
45 | 45 | { |
46 | | - global $wgParser; |
47 | | - |
48 | | - $wgParser->setHook( 'section', array( __CLASS__, 'noop' ) ); |
49 | | - if ( defined( get_class( $wgParser ) . '::SFH_OBJECT_ARGS' ) ) { |
50 | | - $wgParser->setFunctionHook( 'lst', array( __CLASS__, 'pfuncIncludeObj' ), SFH_OBJECT_ARGS ); |
51 | | - $wgParser->setFunctionHook( 'lstx', array( __CLASS__, 'pfuncExcludeObj' ), SFH_OBJECT_ARGS ); |
| 46 | + $parser->setHook( 'section', array( __CLASS__, 'noop' ) ); |
| 47 | + if ( defined( get_class( $parser ) . '::SFH_OBJECT_ARGS' ) ) { |
| 48 | + $parser->setFunctionHook( 'lst', array( __CLASS__, 'pfuncIncludeObj' ), SFH_OBJECT_ARGS ); |
| 49 | + $parser->setFunctionHook( 'lstx', array( __CLASS__, 'pfuncExcludeObj' ), SFH_OBJECT_ARGS ); |
52 | 50 | } else { |
53 | | - $wgParser->setFunctionHook( 'lst', array( __CLASS__, 'pfuncInclude' ) ); |
54 | | - $wgParser->setFunctionHook( 'lstx', array( __CLASS__, 'pfuncExclude' ) ); |
| 51 | + $parser->setFunctionHook( 'lst', array( __CLASS__, 'pfuncInclude' ) ); |
| 52 | + $parser->setFunctionHook( 'lstx', array( __CLASS__, 'pfuncExclude' ) ); |
55 | 53 | } |
56 | 54 | } |
57 | 55 | |