wiki.techinc.nl/includes/htmlform/CollapsibleFieldsetLayout.php
Thiemo Kreuz fd7363a1e1 Fix broken PHPDoc comments that don't start with /**
Change-Id: I8db56ff0f73873864dde260e51adcd729aa74e94
2020-07-23 16:09:41 +00:00

36 lines
856 B
PHP

<?php
/*
* @stable to extend
*/
class CollapsibleFieldsetLayout extends OOUI\FieldsetLayout {
/**
* @stable to call
* @inheritDoc
*/
public function __construct( array $config = [] ) {
parent::__construct( $config );
$this->addClasses( [ 'mw-collapsible' ] );
if ( isset( $config[ 'collapsed' ] ) && $config[ 'collapsed' ] ) {
$this->addClasses( [ 'mw-collapsed' ] );
}
$this->header->addClasses( [ 'mw-collapsible-toggle' ] );
$this->group->addClasses( [ 'mw-collapsible-content' ] );
$this->header->appendContent(
new OOUI\IconWidget( [
'icon' => 'expand',
'label' => wfMessage( 'collapsible-expand' )->text(),
] ),
new OOUI\IconWidget( [
'icon' => 'collapse',
'label' => wfMessage( 'collapsible-collapse' )->text(),
] )
);
$this->header->setAttributes( [
'role' => 'button',
] );
}
}