2022-12-07 19:31:14 +00:00
|
|
|
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
|
|
|
|
use MediaWiki\Skins\Vector\Hooks;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* VectorComponentLanguageButton component
|
|
|
|
*/
|
|
|
|
class VectorComponentLanguageButton implements VectorComponent {
|
2023-01-05 22:59:49 +00:00
|
|
|
/** @var string */
|
|
|
|
private $label;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $label
|
|
|
|
*/
|
|
|
|
public function __construct( string $label ) {
|
|
|
|
$this->label = $label;
|
|
|
|
}
|
2022-12-07 19:31:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
public function getTemplateData(): array {
|
|
|
|
return [
|
|
|
|
'id' => 'p-lang-btn-sticky-header',
|
|
|
|
'class' => 'mw-interlanguage-selector',
|
|
|
|
'is-quiet' => true,
|
|
|
|
'tabindex' => '-1',
|
|
|
|
'html-vector-button-icon' => Hooks::makeIcon( 'wikimedia-language' ),
|
2023-01-05 22:59:49 +00:00
|
|
|
'event' => 'ui.dropdown-p-lang-btn-sticky-header',
|
|
|
|
'label' => $this->label,
|
2022-12-07 19:31:14 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|