MediaWiki REL1_34
CollapsibleFieldsetLayout.php
Go to the documentation of this file.
1<?php
2
3class CollapsibleFieldsetLayout extends OOUI\FieldsetLayout {
4 public function __construct( array $config = [] ) {
5 parent::__construct( $config );
6
7 $this->addClasses( [ 'mw-collapsible' ] );
8 if ( isset( $config[ 'collapsed' ] ) && $config[ 'collapsed' ] ) {
9 $this->addClasses( [ 'mw-collapsed' ] );
10 }
11 $this->header->addClasses( [ 'mw-collapsible-toggle' ] );
12 $this->group->addClasses( [ 'mw-collapsible-content' ] );
13
14 $this->header->appendContent(
15 new OOUI\IconWidget( [
16 'icon' => 'expand',
17 'label' => wfMessage( 'collapsible-expand' )->text(),
18 ] ),
19 new OOUI\IconWidget( [
20 'icon' => 'collapse',
21 'label' => wfMessage( 'collapsible-collapse' )->text(),
22 ] )
23 );
24
25 $this->header->setAttributes( [
26 'role' => 'button',
27 ] );
28 }
29}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.