KartikMistry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/294291
Change subject: WIP: Add wgULSCompactLinksPref variable
......................................................................
WIP: Add wgULSCompactLinksPref variable
This can be used to make Compact Language Links enable/disable in
user preferences.
Change-Id: I535e3c6b59abf43dca7f1a3e19b0fc24fc6c2e04
---
M UniversalLanguageSelector.hooks.php
M extension.json
2 files changed, 10 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
refs/changes/91/294291/1
diff --git a/UniversalLanguageSelector.hooks.php
b/UniversalLanguageSelector.hooks.php
index 6326246..b6c3b16 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -52,7 +52,8 @@
public static function isCompactLinksEnabled( $user ) {
global $wgULSEnable, $wgInterwikiMagic,
$wgULSCompactLinksEnableAnon,
- $wgHideInterlanguageLinks,
$wgULSCompactLanguageLinksBetaFeature;
+ $wgHideInterlanguageLinks,
$wgULSCompactLanguageLinksBetaFeature,
+ $wgULSCompactLinksPref;
// Whether any user visible features are enabled
if ( !$wgULSEnable ) {
@@ -80,6 +81,11 @@
return $user->getBoolOption( 'compact-language-links' );
}
+ if ( $wgULSCompactLinksPref == true ) {
+ $user->setOption( 'compact-language-links', 1 );
+ $user->saveSettings();
+ }
+
return false;
}
diff --git a/extension.json b/extension.json
index c590899..46f9e7a 100644
--- a/extension.json
+++ b/extension.json
@@ -97,7 +97,9 @@
"ULSCompactLinksForNewAccounts": false,
"@ULSCompactLinksForNewAccounts": "Enable compact interlanguage
links for new user accounts.",
"ULSCompactLinksEnableAnon": false,
- "@ULSCompactLinksEnableAnon": "Enable compact interlanguage
links for anonymous users."
+ "@ULSCompactLinksEnableAnon": "Enable compact interlanguage
links for anonymous users.",
+ "ULSCompactLinksPref": false,
+ "@ULSCompactLinksPref": "Enable compact interlanguage links
option in preference."
},
"callback": "UniversalLanguageSelectorHooks::setVersionConstant",
"ResourceModules": {
--
To view, visit https://gerrit.wikimedia.org/r/294291
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I535e3c6b59abf43dca7f1a3e19b0fc24fc6c2e04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: KartikMistry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits