mediawiki-skins-Vector/includes/Components/VectorComponentMainMenuActionLanguageSwitchAlert.php
Jon Robson 9c36435220 VectorComponentMainMenuAction: Have class to distinguish between different actions
It should be possible to style the language alert without impacting the opt in
action.

Bug: T317899
Change-Id: Ifea7d476099ab3a09da20522380664b9ad5eceb3
2022-11-28 20:15:16 +00:00

42 lines
882 B
PHP

<?php
namespace MediaWiki\Skins\Vector\Components;
use Html;
use Skin;
/**
* VectorComponentMainMenuActionLanguageSwitchAlert component
*/
class VectorComponentMainMenuActionLanguageSwitchAlert implements VectorComponent {
/** @var Skin */
private $skin;
/**
* @param Skin $skin
*/
public function __construct( Skin $skin ) {
$this->skin = $skin;
}
/**
* @inheritDoc
*/
public function getTemplateData(): array {
$skin = $this->skin;
$languageSwitchAlert = [
'html-content' => Html::noticeBox(
$skin->msg( 'vector-language-redirect-to-top' )->parse(),
'vector-language-sidebar-alert'
),
];
$headingOptions = [
'heading' => $skin->msg( 'vector-languages' )->plain(),
];
$component = new VectorComponentMainMenuAction(
'lang-alert', $skin, $languageSwitchAlert, $headingOptions
);
return $component->getTemplateData();
}
}