mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-03 03:37:24 +00:00
c10ef66e6e
* Introduce Dropdownmenu, PinnableElement and PinnedContainer components Additional changes: * Drops unused has-multiple-menus * Update TableOfContents to use PinnedContainer and PinnableElement Bug: T317900 Change-Id: I0a740f8543831e266f2b1b874b40e44c8241d4cb
33 lines
638 B
PHP
33 lines
638 B
PHP
<?php
|
|
namespace MediaWiki\Skins\Vector\Components;
|
|
|
|
/**
|
|
* VectorComponentPinnedContainer component
|
|
* To be used with PinnedContainer or UnpinnedContainer templates.
|
|
*/
|
|
class VectorComponentPinnedContainer implements VectorComponent {
|
|
/** @var string */
|
|
private $id;
|
|
/** @var bool */
|
|
private $isPinned;
|
|
|
|
/**
|
|
* @param string $id
|
|
* @param bool $isPinned
|
|
*/
|
|
public function __construct( string $id, bool $isPinned = true ) {
|
|
$this->id = $id;
|
|
$this->isPinned = $isPinned;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getTemplateData(): array {
|
|
return [
|
|
'id' => $this->id,
|
|
'is-pinned' => $this->isPinned,
|
|
];
|
|
}
|
|
}
|