X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=includes%2Fhtmlform%2FOOUIHTMLForm.php;h=94ba75eb0fecbbdc7e2824fccb2ddcc50fad1f9f;hb=388bbf3f7baefea02f9c89c4ade958059fa4282d;hp=e21d783fcc3685ad2dd267e33aed2e32fb4cab96;hpb=a38af7ba26579bb3004f673e44d39710887763aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index e21d783fcc..94ba75eb0f 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -281,8 +281,10 @@ class OOUIHTMLForm extends HTMLForm { public function wrapForm( $html ) { if ( is_string( $this->mWrapperLegend ) ) { - $content = new OOUI\FieldsetLayout( [ + $phpClass = $this->mCollapsible ? CollapsibleFieldsetLayout::class : OOUI\FieldsetLayout::class; + $content = new $phpClass( [ 'label' => $this->mWrapperLegend, + 'collapsed' => $this->mCollapsed, 'items' => [ new OOUI\Widget( [ 'content' => new OOUI\HtmlSnippet( $html ) @@ -293,8 +295,9 @@ class OOUIHTMLForm extends HTMLForm { $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, ] );