return $this->mMethod;
}
+ /**
+ * Wraps the given $section into an user-visible fieldset.
+ *
+ * @param string $legend Legend text for the fieldset
+ * @param string $section The section content in plain Html
+ * @param array $attributes Additional attributes for the fieldset
+ * @return string The fieldset's Html
+ */
+ protected function wrapFieldSetSection( $legend, $section, $attributes ) {
+ return Xml::fieldset( $legend, $section, $attributes ) . "\n";
+ }
+
/**
* @todo Document
*
if ( $fieldsetIDPrefix ) {
$attributes['id'] = Sanitizer::escapeId( "$fieldsetIDPrefix$key" );
}
- $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n";
+ $subsectionHtml .= $this->wrapFieldSetSection( $legend, $section, $attributes );
} else {
// Just return the inputs, nothing fancy.
$subsectionHtml .= $section;
return $html;
}
+ protected function wrapFieldSetSection( $legend, $section, $attributes ) {
+ // to get a user visible effect, wrap the fieldset into a framed panel layout
+ $layout = new OOUI\PanelLayout( array(
+ 'expanded' => false,
+ 'padded' => true,
+ 'framed' => true,
+ 'infusable' => false,
+ ) );
+
+ $layout->appendContent(
+ new OOUI\FieldsetLayout( array(
+ 'label' => $legend,
+ 'infusable' => false,
+ 'items' => array(
+ new OOUI\Widget( array(
+ 'content' => new OOUI\HtmlSnippet( $section )
+ ) ),
+ ),
+ ) + $attributes )
+ );
+ return $layout;
+ }
+
/**
* Put a form section together from the individual fields' HTML, merging it and wrapping.
* @param OOUI\\FieldLayout[] $fieldsHtml