Merge "exception: Add missing early return for UserNotLoggedIn error page"
[lhc/web/wiklou.git] / includes / htmlform / OOUIHTMLForm.php
index e21d783..94ba75e 100644 (file)
@@ -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,
                ] );