mediawiki-skins-Vector/includes/Components/VectorComponentLanguageButton.php
Jon Robson 5508712d33 Refactor: Remove unnecessary function getULSButtonData
Change-Id: I85aaf6087a04376ed0191395413d0ef1ba575a27
2023-01-09 22:52:17 +00:00

35 lines
727 B
PHP

<?php
namespace MediaWiki\Skins\Vector\Components;
use MediaWiki\Skins\Vector\Hooks;
/**
* VectorComponentLanguageButton component
*/
class VectorComponentLanguageButton implements VectorComponent {
/** @var string */
private $label;
/**
* @param string $label
*/
public function __construct( string $label ) {
$this->label = $label;
}
/**
* @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' ),
'event' => 'ui.dropdown-p-lang-btn-sticky-header',
'label' => $this->label,
];
}
}