Index: trunk/extensions/GraphViz/GraphViz.php |
— | — | @@ -128,12 +128,7 @@ |
129 | 129 | * Media Wiki Plugin Stuff |
130 | 130 | */ |
131 | 131 | |
132 | | -// Check if the Wiki supports the new extension syntax |
133 | | -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { |
134 | | - $wgHooks['ParserFirstCallInit'][] = 'wfGraphVizExtension'; |
135 | | -} else { // Otherwise do things the old fashioned way |
136 | | - $wgExtensionFunctions[] = 'wfGraphVizExtension'; |
137 | | -} |
| 132 | +$wgHooks['ParserFirstCallInit'][] = 'wfGraphVizSetHook'; |
138 | 133 | |
139 | 134 | // Information about the people did this Parserhook |
140 | 135 | $wgExtensionCredits['parserhook'][] = array( |
— | — | @@ -154,10 +149,9 @@ |
155 | 150 | /* |
156 | 151 | * Information about the hooks used |
157 | 152 | */ |
158 | | - function wfGraphVizExtension() { |
159 | | - global $wgParser; |
160 | | - $wgParser->setHook( 'graphviz', 'renderGraphviz' ); |
161 | | - $wgParser->setHook( 'mscgen', 'renderMscGen' ); |
| 153 | + function wfGraphVizSetHook( $parser ) { |
| 154 | + $parser->setHook( 'graphviz', 'renderGraphviz' ); |
| 155 | + $parser->setHook( 'mscgen', 'renderMscGen' ); |
162 | 156 | return true; |
163 | 157 | } |
164 | 158 | |
Index: trunk/extensions/HeaderTabs/HeaderTabs.php |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | $wgAutoloadClasses['HeaderTabs'] = "$dir/HeaderTabs_body.yui.php"; |
23 | 23 | } |
24 | 24 | |
25 | | -$wgExtensionFunctions[] = 'htSetupExtension'; |
26 | 25 | $wgExtensionCredits['parserhook'][] = array( |
27 | 26 | 'name' => 'Header Tabs', |
28 | 27 | 'description' => 'Adds tabs to the page separating top-level sections.', |
— | — | @@ -32,26 +31,18 @@ |
33 | 32 | |
34 | 33 | $htUseHistory = true; |
35 | 34 | |
36 | | -function htSetupExtension() { |
37 | | - global $wgHooks; |
38 | | - global $wgParser; |
| 35 | +$wgHooks['ParserFirstCallInit'][] = 'headerTabsParserFunctions'; |
| 36 | +$wgHooks['LanguageGetMagic'][] = 'headerTabsLanguageGetMagic'; |
| 37 | +$wgHooks['BeforePageDisplay'][] = 'HeaderTabs::addHTMLHeader'; |
| 38 | +$wgHooks['ParserAfterTidy'][] = 'HeaderTabs::replaceFirstLevelHeaders'; |
39 | 39 | |
40 | | - $wgHooks['BeforePageDisplay'][] = 'HeaderTabs::addHTMLHeader'; |
41 | | - $wgHooks['ParserAfterTidy'][] = 'HeaderTabs::replaceFirstLevelHeaders'; |
42 | | - $wgParser->setHook( 'headertabs', array( 'HeaderTabs', 'tag' ) ); |
43 | | - |
| 40 | +# Parser function to insert a link changing a tab: |
| 41 | +function headerTabsParserFunctions( $parser ) { |
| 42 | + $parser->setHook( 'headertabs', array( 'HeaderTabs', 'tag' ) ); |
| 43 | + $parser->setFunctionHook( 'switchtablink', array( 'HeaderTabs', 'renderSwitchTabLink' ) ); |
44 | 44 | return true; |
45 | 45 | } |
46 | 46 | |
47 | | -# Parser function to insert a link changing a tab: |
48 | | -$wgExtensionFunctions[] = 'headerTabsParserFunctions'; |
49 | | -$wgHooks['LanguageGetMagic'][] = 'headerTabsLanguageGetMagic'; |
50 | | - |
51 | | -function headerTabsParserFunctions() { |
52 | | - global $wgParser; |
53 | | - $wgParser->setFunctionHook( 'switchtablink', array( 'HeaderTabs', 'renderSwitchTabLink' ) ); |
54 | | -} |
55 | | - |
56 | 47 | function headerTabsLanguageGetMagic( &$magicWords, $langCode = "en" ) { |
57 | 48 | switch ( $langCode ) { |
58 | 49 | default: |