Merge "Add config for language in header for logged in/out users"

This commit is contained in:
jenkins-bot 2021-04-16 17:49:43 +00:00 committed by Gerrit Code Review
commit e637cef2c2
2 changed files with 24 additions and 8 deletions

View File

@ -69,12 +69,25 @@ return [
// Feature: Languages in sidebar // Feature: Languages in sidebar
// ================================ // ================================
$featureManager->registerRequirement( $config = $services->getMainConfig();
new DynamicConfigRequirement( $languageInHeaderConfig = $config->get( Constants::CONFIG_KEY_LANGUAGE_IN_HEADER );
$services->getMainConfig(),
Constants::CONFIG_KEY_LANGUAGE_IN_HEADER, // Backwards compatibility with config variables that have been set in production.
Constants::REQUIREMENT_LANGUAGE_IN_HEADER if ( is_bool( $languageInHeaderConfig ) ) {
) $languageInHeaderConfig = [
'logged_in' => $languageInHeaderConfig,
'logged_out' => $languageInHeaderConfig,
];
} else {
$languageInHeaderConfig = [
'logged_in' => $languageInHeaderConfig['logged_in'] ?? false,
'logged_out' => $languageInHeaderConfig['logged_out'] ?? false,
];
}
$featureManager->registerSimpleRequirement(
Constants::REQUIREMENT_LANGUAGE_IN_HEADER,
$languageInHeaderConfig[ $context->getUser()->isRegistered() ? 'logged_in' : 'logged_out' ]
); );
$featureManager->registerFeature( $featureManager->registerFeature(

View File

@ -277,8 +277,11 @@
"value": false "value": false
}, },
"VectorLanguageInHeader": { "VectorLanguageInHeader": {
"value": false, "value": {
"description": "@var boolean Moves the language links from the sidebar into a menu beside the page title. Also moves the indicators to the line below, next to the tagline (siteSub)." "logged_in": false,
"logged_out": false
},
"description": "@var array Moves the language links from the sidebar into a menu beside the page title. Also moves the indicators to the line below, next to the tagline (siteSub)."
}, },
"VectorDisableSidebarPersistence": { "VectorDisableSidebarPersistence": {
"value": false, "value": false,