Index: trunk/extensions/SpecialFileList/SpecialFilelist.php |
— | — | @@ -11,7 +11,6 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -$wgExtensionFunctions[] = 'wfSpecialFilelist'; |
16 | 15 | $wgExtensionCredits['specialpage'][] = array( |
17 | 16 | 'path' => __FILE__, |
18 | 17 | 'name' => 'File list', |
Index: trunk/extensions/SpecialTalk/SpecialTalk.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason |
14 | 14 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
15 | 15 | */ |
16 | | -$wgExtensionFunctions[] = 'wfSpecialTalk'; |
| 16 | + |
17 | 17 | $wgExtensionCredits['other'][] = array( |
18 | 18 | 'path' => __FILE__, |
19 | 19 | 'name' => 'SpecialTalk', |
— | — | @@ -28,33 +28,22 @@ |
29 | 29 | // Extension messages. |
30 | 30 | $wgExtensionMessagesFiles['SpecialTalk'] = $dir . 'SpecialTalk.i18n.php'; |
31 | 31 | |
32 | | -function wfSpecialTalk() { |
33 | | - class SpecialTalk { |
34 | | - public function __construct() { |
35 | | - global $wgHooks; |
| 32 | +$wgHooks['SkinTemplateBuildContentActionUrlsAfterSpecialPage'][] = 'wfSpecialTalkHook'; |
36 | 33 | |
37 | | - $wgHooks['SkinTemplateBuildContentActionUrlsAfterSpecialPage'][] = array( &$this, 'SpecialTalkHook' ); |
38 | | - } |
| 34 | +function wfSpecialTalkHook( SkinTemplate &$skin_template, array &$content_actions ) { |
| 35 | + $title = Title::makeTitle( NS_PROJECT_TALK, $skin_template->mTitle->getText() ); |
39 | 36 | |
40 | | - public function SpecialTalkHook( SkinTemplate &$skin_template, array &$content_actions ) { |
41 | | - $title = Title::makeTitle( NS_PROJECT_TALK, $skin_template->mTitle->getText() ); |
| 37 | + $content_actions['talk'] = $skin_template->tabAction( |
| 38 | + $title, |
| 39 | + // msg |
| 40 | + 'talk', |
| 41 | + // selected |
| 42 | + false, |
| 43 | + // &query= |
| 44 | + '', |
| 45 | + // check existance |
| 46 | + true |
| 47 | + ); |
42 | 48 | |
43 | | - $content_actions['talk'] = $skin_template->tabAction( |
44 | | - $title, |
45 | | - // msg |
46 | | - 'talk', |
47 | | - // selected |
48 | | - false, |
49 | | - // &query= |
50 | | - '', |
51 | | - // check existance |
52 | | - true |
53 | | - ); |
54 | | - |
55 | | - return true; |
56 | | - } |
57 | | - } |
58 | | - |
59 | | - // Establish a singleton. |
60 | | - new SpecialTalk; |
| 49 | + return true; |
61 | 50 | } |
Index: trunk/extensions/SkinPerPage/SkinPerPage.php |
— | — | @@ -17,13 +17,13 @@ |
18 | 18 | |
19 | 19 | $wgExtensionMessagesFiles['SkinPerPage'] = dirname( __FILE__ ) . "/SkinPerPage.i18n.php"; |
20 | 20 | |
21 | | -$wgExtensionFunctions[] = array( 'SkinPerPage', 'setup' ); |
| 21 | +$wgHooks['ParserFirstCallInit'][] = 'SkinPerPage::setup'; |
22 | 22 | $wgHooks['OutputPageParserOutput'][] = 'SkinPerPage::outputHook'; |
23 | 23 | |
24 | 24 | class SkinPerPage { |
25 | | - static function setup() { |
26 | | - global $wgParser; |
27 | | - $wgParser->setHook( 'skin', array( __CLASS__, 'parserHook' ) ); |
| 25 | + static function setup( $parser ) { |
| 26 | + $parser->setHook( 'skin', array( __CLASS__, 'parserHook' ) ); |
| 27 | + return true; |
28 | 28 | } |
29 | 29 | |
30 | 30 | static function parserHook( $text, $attribs, $parser ) { |
Index: trunk/extensions/StockCharts/StockCharts.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | * |
19 | 19 | */ |
20 | 20 | |
21 | | -$wgExtensionFunctions[] = 'efStockCharts'; |
| 21 | +$wgHooks['ParserFirstCallInit'][] = 'efStockChartsSetHooks'; |
22 | 22 | $wgHooks['LanguageGetMagic'][] = 'efStockChartsMagic'; |
23 | 23 | |
24 | 24 | $wgExtensionCredits['parserhook'][] = array( |
— | — | @@ -34,11 +34,10 @@ |
35 | 35 | |
36 | 36 | $wgAutoloadClasses['StockCharts'] = dirname( __FILE__ ) . '/StockCharts_body.php'; |
37 | 37 | |
38 | | -// CHECKME: use $wgHooks['ParserFirstCallInit'] here? |
39 | | -function efStockCharts() { |
40 | | - global $wgParser; |
41 | | - $wgParser->setHook( 'stockchart', array( 'StockCharts', 'renderTagExtension' ) ); // hook for <stockchart ../> |
42 | | - $wgParser->setFunctionHook( 'stockchart', array( 'StockCharts', 'renderParserFunction' ) ); // hook for {{#stockchart ..}} |
| 38 | +function efStockChartsSetHooks( $parser ) { |
| 39 | + $parser->setHook( 'stockchart', array( 'StockCharts', 'renderTagExtension' ) ); // hook for <stockchart ../> |
| 40 | + $parser->setFunctionHook( 'stockchart', array( 'StockCharts', 'renderParserFunction' ) ); // hook for {{#stockchart ..}} |
| 41 | + return true; |
43 | 42 | } |
44 | 43 | |
45 | 44 | function efStockChartsMagic( &$magicWords, $langCode ) { |
Index: trunk/extensions/EmbedVideo/EmbedVideo.hooks.php |
— | — | @@ -12,21 +12,15 @@ |
13 | 13 | /** |
14 | 14 | * Sets up parser functions. |
15 | 15 | */ |
16 | | - public static function setup() { |
| 16 | + public static function setup( $parser ) { |
17 | 17 | # Setup parser hooks. ev is the primary hook, evp is supported for |
18 | 18 | # legacy purposes |
19 | | - $prefix = ''; |
20 | | - EmbedVideo::addMagicWord( $prefix, "ev", "EmbedVideo::parserFunction_ev" ); |
21 | | - EmbedVideo::addMagicWord( $prefix, "evp", "EmbedVideo::parserFunction_evp" ); |
| 19 | + $parser->setFunctionHook( 'ev', 'EmbedVideo::parserFunction_ev' ); |
| 20 | + $parser->setFunctionHook( 'evp', 'EmbedVideo::parserFunction_evp' ); |
22 | 21 | |
23 | 22 | return true; |
24 | 23 | } |
25 | 24 | |
26 | | - private static function addMagicWord( $prefix, $word, $function ) { |
27 | | - global $wgParser; |
28 | | - $wgParser->setFunctionHook( $prefix . $word, $function ); |
29 | | - } |
30 | | - |
31 | 25 | /** |
32 | 26 | ** Adds magic words for parser functions. |
33 | 27 | * @param Array $magicWords |