mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-15 03:43:55 +00:00
Nuking fallback code for MW < 1.12 in most extensions (there's like 5 or 6 left I haven't done). Couple of points:
* 1.11 and below aren't supported anymore, so we don't need to be maintaining back-compat code for it anymore. This is why we branch extensions * The vast majority of these were using $wgParser. This defeats the purpose of ParserFirstCallInit...allowing you to use parsers other than $wgParser. All these extensions now work in any instance of the Parser, not just $wgParser
This commit is contained in:
parent
009be65358
commit
1db4e16297
|
@ -154,7 +154,7 @@ $wgAjaxExportList[] = 'efCategoryTreeAjaxWrapper';
|
|||
function efCategoryTree() {
|
||||
global $wgUseAjax, $wgHooks, $wgOut;
|
||||
global $wgCategoryTreeDefaultOptions, $wgCategoryTreeDefaultMode, $wgCategoryTreeOmitNamespace;
|
||||
global $wgCategoryTreeCategoryPageOptions, $wgCategoryTreeCategoryPageMode;
|
||||
global $wgCategoryTreeCategoryPageOptions, $wgCategoryTreeCategoryPageMode, $wgCategoryTreeAllowTag;
|
||||
global $wgCategoryTreeSidebarRoot, $wgCategoryTreeForceHeaders, $wgCategoryTreeHijackPageCategories;
|
||||
|
||||
# Abort if AJAX is not enabled
|
||||
|
@ -174,10 +174,8 @@ function efCategoryTree() {
|
|||
$wgHooks['SkinJoinCategoryLinks'][] = 'efCategoryTreeSkinJoinCategoryLinks';
|
||||
}
|
||||
|
||||
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
|
||||
if( $wgCategoryTreeAllowTag ) {
|
||||
$wgHooks['ParserFirstCallInit'][] = 'efCategoryTreeSetHooks';
|
||||
} else {
|
||||
efCategoryTreeSetHooks();
|
||||
}
|
||||
|
||||
if ( !isset( $wgCategoryTreeDefaultOptions['mode'] ) || is_null( $wgCategoryTreeDefaultOptions['mode'] ) ) {
|
||||
|
@ -200,12 +198,9 @@ function efCategoryTree() {
|
|||
}
|
||||
}
|
||||
|
||||
function efCategoryTreeSetHooks() {
|
||||
global $wgParser, $wgCategoryTreeAllowTag;
|
||||
if ( $wgCategoryTreeAllowTag ) {
|
||||
$wgParser->setHook( 'categorytree' , 'efCategoryTreeParserHook' );
|
||||
$wgParser->setFunctionHook( 'categorytree' , 'efCategoryTreeParserFunction' );
|
||||
}
|
||||
function efCategoryTreeSetHooks( &$parser ) {
|
||||
$parser->setHook( 'categorytree' , 'efCategoryTreeParserHook' );
|
||||
$parser->setFunctionHook( 'categorytree' , 'efCategoryTreeParserFunction' );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue