mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 09:43:06 +00:00
Get config values from Config instead of from global variables
Change-Id: I316b892ed01472fac75f72f50c820676fb3ce58a
This commit is contained in:
parent
0b7559cba4
commit
06dcae70b4
|
@ -136,11 +136,13 @@ class Hooks implements
|
|||
* @return bool|string of link
|
||||
*/
|
||||
private function getCategorySidebarBox() {
|
||||
global $wgCategoryTreeSidebarRoot, $wgCategoryTreeSidebarOptions;
|
||||
if ( !$wgCategoryTreeSidebarRoot ) {
|
||||
if ( !$this->config->get( 'CategoryTreeSidebarRoot' ) ) {
|
||||
return false;
|
||||
}
|
||||
return self::parserHook( $wgCategoryTreeSidebarRoot, $wgCategoryTreeSidebarOptions );
|
||||
return $this->parserHook(
|
||||
$this->config->get( 'CategoryTreeSidebarRoot' ),
|
||||
$this->config->get( 'CategoryTreeSidebarOptions' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,15 +250,14 @@ class Hooks implements
|
|||
* @return bool
|
||||
*/
|
||||
public function onOutputPageMakeCategoryLinks( $out, $categories, &$links ) {
|
||||
global $wgCategoryTreePageCategoryOptions, $wgCategoryTreeHijackPageCategories;
|
||||
|
||||
if ( !$wgCategoryTreeHijackPageCategories ) {
|
||||
if ( !$this->config->get( 'CategoryTreeHijackPageCategories' ) ) {
|
||||
// Not enabled, don't do anything
|
||||
return true;
|
||||
}
|
||||
|
||||
$options = $this->config->get( 'CategoryTreePageCategoryOptions' );
|
||||
foreach ( $categories as $category => $type ) {
|
||||
$links[$type][] = $this->parserHook( $category, $wgCategoryTreePageCategoryOptions, null, null, true );
|
||||
$links[$type][] = $this->parserHook( $category, $options, null, null, true );
|
||||
}
|
||||
CategoryTree::setHeaders( $out );
|
||||
|
||||
|
|
Loading…
Reference in a new issue