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