MW 1.35: Re-add class attribute for ULS

Without the class attribute, the ULS does not open on MW <= 1.35.
This was changed in Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0

Bug: T294021
Change-Id: I1bcf4e442e85f8848c5e4ff5609204602265b949
This commit is contained in:
Abijeet
2021-10-27 03:11:35 +05:30
committed by jenkins-bot
parent 265886394c
commit 4d8131af10

View File

@@ -220,18 +220,30 @@ class UniversalLanguageSelectorHooks {
// The element id will be 'pt-uls' // The element id will be 'pt-uls'
$langCode = $context->getLanguage()->getCode(); $langCode = $context->getLanguage()->getCode();
return [
'uls' => [ if ( version_compare( MW_VERSION, '1.36', '<' ) ) {
'text' => Language::fetchLanguageName( $langCode ), return [
'href' => '#', 'uls' => [
// Skin meta data to allow skin (e.g. Vector) to add icons 'text' => Language::fetchLanguageName( $langCode ),
'icon' => 'wikimedia-language', 'href' => '#',
// Skin meta data to allow skin (e.g. Vector) to convert to button. 'class' => 'uls-trigger',
'button' => true, 'active' => true
'link-class' => [ 'uls-trigger' ], ]
'active' => true ] + $personal_urls;
] } else {
] + $personal_urls; return [
'uls' => [
'text' => Language::fetchLanguageName( $langCode ),
'href' => '#',
// Skin meta data to allow skin (e.g. Vector) to add icons
'icon' => 'wikimedia-language',
// Skin meta data to allow skin (e.g. Vector) to convert to button.
'button' => true,
'link-class' => [ 'uls-trigger' ],
'active' => true
]
] + $personal_urls;
}
} }
/** /**