X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhtmlform%2FOOUIHTMLForm.php;h=baafa5e7215467f152ef650b64b8b3a8ada12926;hb=a5230acd936b5b9270037c35b9d2d419f4c8d9a6;hp=e7e3ff633395868176578dc05bfbecd396f9ac5b;hpb=644dd792caa651a8279e786fc8fc2418eefc7811;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/OOUIHTMLForm.php b/includes/htmlform/OOUIHTMLForm.php index e7e3ff6333..baafa5e721 100644 --- a/includes/htmlform/OOUIHTMLForm.php +++ b/includes/htmlform/OOUIHTMLForm.php @@ -145,6 +145,10 @@ class OOUIHTMLForm extends HTMLForm { [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n"; } + /** + * @inheritDoc + * @return OOUI\PanelLayout + */ protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) { // to get a user visible effect, wrap the fieldset into a framed panel layout $layout = new OOUI\PanelLayout( [ @@ -277,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, + 'classes' => $classes, + 'group' => new OOUI\StackLayout( [ + 'expanded' => false, + 'classes' => [ '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, ] );