Add config to enable compact links for new accounts

By default the value is false.

Change-Id: I30e9c3d929158d9ebe90edfcb10c90712ad294f9
This commit is contained in:
Santhosh Thottingal
2016-05-10 09:57:48 +05:30
parent 7a82c2fcba
commit 35e7d72e35
2 changed files with 17 additions and 1 deletions

View File

@@ -82,6 +82,19 @@ class UniversalLanguageSelectorHooks {
return false; return false;
} }
/**
* Sets user preference to enable the Compact language links if the
* user account is new.
*
* To be removed once no longer needed.
*/
public static function onLocalUserCreated( User $user, $autoCreate ) {
if ( RequestContext::getMain()->getConfig()->get( 'ULSCompactLinksForNewAccounts' ) ) {
$user->setOption( 'compact-language-links', 1 );
$user->saveSettings();
}
}
/** /**
* @param OutputPage $out * @param OutputPage $out
* @param Skin $skin * @param Skin $skin

View File

@@ -20,6 +20,7 @@
"EventLoggingRegisterSchemas": "UniversalLanguageSelectorHooks::onEventLoggingRegisterSchemas", "EventLoggingRegisterSchemas": "UniversalLanguageSelectorHooks::onEventLoggingRegisterSchemas",
"GetBetaFeaturePreferences": "UniversalLanguageSelectorHooks::onGetBetaFeaturePreferences", "GetBetaFeaturePreferences": "UniversalLanguageSelectorHooks::onGetBetaFeaturePreferences",
"GetPreferences": "UniversalLanguageSelectorHooks::onGetPreferences", "GetPreferences": "UniversalLanguageSelectorHooks::onGetPreferences",
"LocalUserCreated": "UniversalLanguageSelectorHooks::onLocalUserCreated",
"MakeGlobalVariablesScript": "UniversalLanguageSelectorHooks::addVariables", "MakeGlobalVariablesScript": "UniversalLanguageSelectorHooks::addVariables",
"PersonalUrls": "UniversalLanguageSelectorHooks::addPersonalBarTrigger", "PersonalUrls": "UniversalLanguageSelectorHooks::addPersonalBarTrigger",
"ResourceLoaderGetConfigVars": "UniversalLanguageSelectorHooks::addConfig", "ResourceLoaderGetConfigVars": "UniversalLanguageSelectorHooks::addConfig",
@@ -92,7 +93,9 @@
"@ULSFontRepositoryBasePath": "Base path of ULS font repository. If not set, will be set to 'UniversalLanguageSelector/data/fontrepo/fonts/', relative to $wgExtensionAssetsPath. @since 2013.10", "@ULSFontRepositoryBasePath": "Base path of ULS font repository. If not set, will be set to 'UniversalLanguageSelector/data/fontrepo/fonts/', relative to $wgExtensionAssetsPath. @since 2013.10",
"ULSFontRepositoryBasePath": false, "ULSFontRepositoryBasePath": false,
"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": "Enable compact interlanguage links for new user accounts."
}, },
"callback": "UniversalLanguageSelectorHooks::setVersionConstant", "callback": "UniversalLanguageSelectorHooks::setVersionConstant",
"ResourceModules": { "ResourceModules": {