mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-27 15:40:15 +00:00
Revert "Use array instead of string for class list"
This reverts commit c12f61709b
.
Reason for revert: Does not work and broke the train
Bug: T378531
Change-Id: I3a91169276b8ebffbdf409aac4e3731298047196
This commit is contained in:
parent
ecd660e0f7
commit
7b819ad803
|
@ -32,8 +32,8 @@ class LanguageSelectorEntry implements IMenuEntry {
|
|||
private string $icon;
|
||||
/** @var string A translatable label used as text and title */
|
||||
private string $label;
|
||||
/** @var array additional classes */
|
||||
private array $classes;
|
||||
/** @var string additional classes */
|
||||
private string $classes;
|
||||
|
||||
/**
|
||||
* LanguageSelectorEntry constructor.
|
||||
|
@ -42,7 +42,7 @@ class LanguageSelectorEntry implements IMenuEntry {
|
|||
* languages or variants
|
||||
* @param MessageLocalizer $messageLocalizer Used for translation texts
|
||||
* @param bool $isButton
|
||||
* @param array $classes page classes
|
||||
* @param string $classes page classes
|
||||
* @param string $label Menu entry label and title
|
||||
*/
|
||||
public function __construct(
|
||||
|
@ -50,7 +50,7 @@ class LanguageSelectorEntry implements IMenuEntry {
|
|||
$doesPageHaveLanguages,
|
||||
MessageLocalizer $messageLocalizer,
|
||||
$isButton = false,
|
||||
array $classes = [],
|
||||
$classes = '',
|
||||
$label = 'mobile-frontend-language-article-heading'
|
||||
) {
|
||||
$this->title = $title;
|
||||
|
@ -80,19 +80,19 @@ class LanguageSelectorEntry implements IMenuEntry {
|
|||
*/
|
||||
public function getComponents(): array {
|
||||
$switcherLink = false;
|
||||
$switcherClasses = [ 'language-selector' ];
|
||||
$switcherClasses = ' language-selector';
|
||||
|
||||
if ( $this->doesPageHaveLanguages ) {
|
||||
$switcherLink = '#p-lang';
|
||||
} else {
|
||||
$switcherClasses[] = 'disabled';
|
||||
$switcherClasses .= ' disabled';
|
||||
}
|
||||
$msg = $this->messageLocalizer->msg( $this->label );
|
||||
|
||||
return [
|
||||
[
|
||||
'tag-name' => 'a',
|
||||
'classes' => $this->classes + $switcherClasses,
|
||||
'classes' => $this->classes . ' ' . $switcherClasses,
|
||||
'label' => $msg,
|
||||
'data-icon' => [
|
||||
'icon' => $this->icon,
|
||||
|
|
|
@ -66,7 +66,7 @@ class UserNamespaceOverflowBuilder extends DefaultOverflowBuilder {
|
|||
$this->getMessageLocalizer(),
|
||||
false,
|
||||
// no additional classes
|
||||
[],
|
||||
'',
|
||||
'minerva-page-actions-language-switcher'
|
||||
) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue