Rename RelatedArticlesFooterWhitelistedSkins to RelatedArticlesFooterAllowedSkins

Bug: T277958
Change-Id: I468a38df92347cc764e0457d4598bedfc4d92efa
This commit is contained in:
Reedy 2021-04-19 01:26:58 +01:00 committed by Sam Smith
parent 5bf0e2906b
commit 2715c27bbe
3 changed files with 12 additions and 3 deletions

View file

@ -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": {

View file

@ -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 );
}

View file

@ -2,3 +2,5 @@
$wgRelatedArticlesUseCirrusSearch = true;
$wgRelatedArticlesOnlyUseCirrusSearch = false;
$wgRelatedArticlesFooterAllowedSkins = [ 'minerva' ];