X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FOOUIHTMLForm.php;h=22ece4c58e36b153fac97d363c87c4a1fc1e993b;hb=63e017f4fc080fdd3b1d9b355ad234fda5e0c12a;hp=e21d783fcc3685ad2dd267e33aed2e32fb4cab96;hpb=a38af7ba26579bb3004f673e44d39710887763aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index e21d783fcc..22ece4c58e 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -281,20 +281,30 @@ class OOUIHTMLForm extends HTMLForm { public function wrapForm( $html ) { if ( is_string( $this->mWrapperLegend ) ) { + $classes = $this->mCollapsible ? [ 'mw-collapsible' ] : []; + if ( $this->mCollapsed ) { + $classes[] = 'mw-collapsed'; + } $content = new OOUI\FieldsetLayout( [ 'label' => $this->mWrapperLegend, - 'items' => [ - new OOUI\Widget( [ - 'content' => new OOUI\HtmlSnippet( $html ) - ] ), - ], + 'classes' => $classes, + 'group' => new OOUI\StackLayout( [ + 'expanded' => false, + 'classes' => [ 'oo-ui-fieldsetLayout-group mw-collapsible-content' ], + 'items' => [ + new OOUI\Widget( [ + 'content' => new OOUI\HtmlSnippet( $html ) + ] ), + ], + ] ), ] + OOUI\Element::configFromHtmlAttributes( $this->mWrapperAttributes ) ); } else { $content = new OOUI\HtmlSnippet( $html ); } + $classes = [ 'mw-htmlform', 'mw-htmlform-ooui' ]; $form = new OOUI\FormLayout( $this->getFormAttributes() + [ - 'classes' => [ 'mw-htmlform', 'mw-htmlform-ooui' ], + 'classes' => $classes, 'content' => $content, ] );