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.