From cd5deee70b83b11beab3ab09bc0a8f03461d5fcf Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 14 Aug 2009 11:25:54 +0000 Subject: [PATCH] * Babel, CategoryTree, MagicNoNumberedHeadings, RegexFunctions and SmoothGallery: new style magic words * MagicNoNumberedHeadings: add extension description in i18n file, reindent * bump versions where applicable --- CategoryTree.i18n.magic.php | 15 +++++++++++++++ CategoryTree.php | 20 +++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 CategoryTree.i18n.magic.php diff --git a/CategoryTree.i18n.magic.php b/CategoryTree.i18n.magic.php new file mode 100644 index 00000000..30decd27 --- /dev/null +++ b/CategoryTree.i18n.magic.php @@ -0,0 +1,15 @@ + array( 0, 'categorytree' ), +); diff --git a/CategoryTree.php b/CategoryTree.php index 2a9accd2..dc366c9c 100644 --- a/CategoryTree.php +++ b/CategoryTree.php @@ -129,6 +129,11 @@ $wgExtensionCredits['parserhook'][] = array( * Register the special page */ $dir = dirname(__FILE__) . '/'; + +if ( $wgUseAjax && $wgCategoryTreeAllowTag ) { + $wgExtensionMessagesFiles['CategoryTreeMagic'] = $dir . 'CategoryTree.i18n.magic.php'; +} + $wgExtensionMessagesFiles['CategoryTree'] = $dir . 'CategoryTree.i18n.php'; $wgAutoloadClasses['CategoryTreePage'] = $dir . 'CategoryTreePage.php'; $wgAutoloadClasses['CategoryTree'] = $dir . 'CategoryTreeFunctions.php'; @@ -137,7 +142,6 @@ $wgSpecialPages['CategoryTree'] = 'CategoryTreePage'; $wgSpecialPageGroups['CategoryTree'] = 'pages'; #$wgHooks['SkinTemplateTabs'][] = 'efCategoryTreeInstallTabs'; $wgHooks['ArticleFromTitle'][] = 'efCategoryTreeArticleFromTitle'; -$wgHooks['LanguageGetMagic'][] = 'efCategoryTreeGetMagic'; /** * register Ajax function @@ -205,20 +209,6 @@ function efCategoryTreeSetHooks() { return true; } -/** -* Hook magic word -*/ -function efCategoryTreeGetMagic( &$magicWords, $langCode ) { - global $wgUseAjax, $wgCategoryTreeAllowTag; - - if ( $wgUseAjax && $wgCategoryTreeAllowTag ) { - //XXX: should we allow a local alias? - $magicWords['categorytree'] = array( 0, 'categorytree' ); - } - - return true; -} - /** * Entry point for Ajax, registered in $wgAjaxExportList. * The $enc parameter determins how the $options is decoded into a PHP array.