Add config to enable compact language links for anonymous users
By default, the value is false. Change-Id: I16dd24182c6e2b8e5e63ebfc0ea305a3511a9e1d
This commit is contained in:
committed by
Nikerabbit
parent
35e7d72e35
commit
02da4454e2
@@ -50,7 +50,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function isCompactLinksEnabled( $user ) {
|
public static function isCompactLinksEnabled( $user ) {
|
||||||
global $wgULSEnable, $wgULSEnableAnon, $wgInterwikiMagic,
|
global $wgULSEnable, $wgInterwikiMagic,
|
||||||
|
$wgULSCompactLinksEnableAnon,
|
||||||
$wgHideInterlanguageLinks, $wgULSCompactLanguageLinksBetaFeature;
|
$wgHideInterlanguageLinks, $wgULSCompactLanguageLinksBetaFeature;
|
||||||
|
|
||||||
// Whether any user visible features are enabled
|
// Whether any user visible features are enabled
|
||||||
@@ -58,8 +59,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !$wgULSEnableAnon && $user->isAnon() ) {
|
if ( $user->isAnon() && $wgULSCompactLinksEnableAnon ) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $wgULSCompactLanguageLinksBetaFeature === true &&
|
if ( $wgULSCompactLanguageLinksBetaFeature === true &&
|
||||||
|
|||||||
@@ -95,7 +95,9 @@
|
|||||||
"ULSCompactLanguageLinksBetaFeature": true,
|
"ULSCompactLanguageLinksBetaFeature": true,
|
||||||
"@ULSCompactLanguageLinksBetaFeature": "Set compact interlanguage links as beta feature or not. If set false, compact interlanguage links will be available by default to all users.",
|
"@ULSCompactLanguageLinksBetaFeature": "Set compact interlanguage links as beta feature or not. If set false, compact interlanguage links will be available by default to all users.",
|
||||||
"ULSCompactLinksForNewAccounts": false,
|
"ULSCompactLinksForNewAccounts": false,
|
||||||
"@ULSCompactLinksForNewAccounts": "Enable compact interlanguage links for new user accounts."
|
"@ULSCompactLinksForNewAccounts": "Enable compact interlanguage links for new user accounts.",
|
||||||
|
"ULSCompactLinksEnableAnon": false,
|
||||||
|
"@ULSCompactLinksEnableAnon": "Enable compact interlanguage links for anonymous users."
|
||||||
},
|
},
|
||||||
"callback": "UniversalLanguageSelectorHooks::setVersionConstant",
|
"callback": "UniversalLanguageSelectorHooks::setVersionConstant",
|
||||||
"ResourceModules": {
|
"ResourceModules": {
|
||||||
|
|||||||
Reference in New Issue
Block a user