Change-Id: I3551667b1f64a3cd9227b07df2a215ccb701ea5d
->setAction( wfScript() )
->setId( 'mw-history-searchform' )
->setSubmitText( $this->msg( 'historyaction-submit' )->text() )
->setAction( wfScript() )
->setId( 'mw-history-searchform' )
->setSubmitText( $this->msg( 'historyaction-submit' )->text() )
+ ->setWrapperAttributes( [ 'id' => 'mw-history-search' ] )
->setWrapperLegend( $this->msg( 'history-fieldset-title' )->text() );
$htmlForm->loadData();
->setWrapperLegend( $this->msg( 'history-fieldset-title' )->text() );
$htmlForm->loadData();
protected $mButtons = [];
protected $mWrapperLegend = false;
protected $mButtons = [];
protected $mWrapperLegend = false;
+ protected $mWrapperAttributes = [];
/**
* Salt for the edit token.
/**
* Salt for the edit token.
# Include a <fieldset> wrapper for style, if requested.
if ( $this->mWrapperLegend !== false ) {
$legend = is_string( $this->mWrapperLegend ) ? $this->mWrapperLegend : false;
# Include a <fieldset> wrapper for style, if requested.
if ( $this->mWrapperLegend !== false ) {
$legend = is_string( $this->mWrapperLegend ) ? $this->mWrapperLegend : false;
- $html = Xml::fieldset( $legend, $html );
+ $html = Xml::fieldset( $legend, $html, $this->mWrapperAttributes );
}
return Html::rawElement(
}
return Html::rawElement(
+ /**
+ * For internal use only. Use is discouraged, and should only be used where
+ * support for gadgets/user scripts is warranted.
+ * @param array $attributes
+ * @internal
+ * @return HTMLForm $this for chaining calls
+ */
+ public function setWrapperAttributes( $attributes ) {
+ $this->mWrapperAttributes = $attributes;
+
+ return $this;
+ }
+
/**
* Prompt the whole form to be wrapped in a "<fieldset>", with
* this message as its "<legend>" element.
/**
* Prompt the whole form to be wrapped in a "<fieldset>", with
* this message as its "<legend>" element.
'content' => new OOUI\HtmlSnippet( $html )
] ),
],
'content' => new OOUI\HtmlSnippet( $html )
] ),
],
+ ] + OOUI\Element::configFromHtmlAttributes( $this->mWrapperAttributes ) );
} else {
$content = new OOUI\HtmlSnippet( $html );
}
} else {
$content = new OOUI\HtmlSnippet( $html );
}