mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
Rename RelatedArticlesFooterWhitelistedSkins to RelatedArticlesFooterAllowedSkins
Bug: T277958 Change-Id: I468a38df92347cc764e0457d4598bedfc4d92efa
This commit is contained in:
parent
5bf0e2906b
commit
2715c27bbe
|
@ -156,9 +156,13 @@
|
|||
"description": "Source to get the page description from (string, or false to not fetch the description). Possible values: wikidata, textextracts, pagedescription.",
|
||||
"value": false
|
||||
},
|
||||
"RelatedArticlesFooterWhitelistedSkins": {
|
||||
"RelatedArticlesFooterAllowedSkins": {
|
||||
"description": "List of skin names (e.g. 'minerva') where related articles will be shown in the footer.",
|
||||
"value": []
|
||||
},
|
||||
"RelatedArticlesFooterWhitelistedSkins": {
|
||||
"description": "DEPRECATED: Use $wgRelatedArticlesFooterAllowedSkins instead",
|
||||
"value": []
|
||||
}
|
||||
},
|
||||
"ConfigRegistry": {
|
||||
|
|
|
@ -63,7 +63,7 @@ class Hooks {
|
|||
* Is ReadMore allowed on skin?
|
||||
*
|
||||
* Some wikis may want to only enable the feature on some skins, so we'll only
|
||||
* show it if the whitelist (`RelatedArticlesFooterWhitelistedSkins`
|
||||
* show it if the allow list (`RelatedArticlesFooterAllowedSkins`
|
||||
* configuration variable) is empty or the skin is listed.
|
||||
*
|
||||
* @param User $user
|
||||
|
@ -73,7 +73,10 @@ class Hooks {
|
|||
private static function isReadMoreAllowedOnSkin( User $user, Skin $skin ) {
|
||||
$config = MediaWikiServices::getInstance()->getConfigFactory()
|
||||
->makeConfig( 'RelatedArticles' );
|
||||
$skins = $config->get( 'RelatedArticlesFooterWhitelistedSkins' );
|
||||
$skins = array_merge(
|
||||
$config->get( 'RelatedArticlesFooterAllowedSkins' ),
|
||||
$config->get( 'RelatedArticlesFooterWhitelistedSkins' )
|
||||
);
|
||||
$skinName = $skin->getSkinName();
|
||||
return empty( $skins ) || in_array( $skinName, $skins );
|
||||
}
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
|
||||
$wgRelatedArticlesUseCirrusSearch = true;
|
||||
$wgRelatedArticlesOnlyUseCirrusSearch = false;
|
||||
|
||||
$wgRelatedArticlesFooterAllowedSkins = [ 'minerva' ];
|
||||
|
|
Loading…
Reference in a new issue