This will allow gadget developers greater control, e.g. disabling.
Change-Id: I9a21cd2dd3fc7695fc09632b844cc1afd0db0355
return new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'value' => $summary,
return new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'value' => $summary,
] + $inputAttrs ),
[
'label' => new OOUI\HtmlSnippet( $labelText ),
] + $inputAttrs ),
[
'label' => new OOUI\HtmlSnippet( $labelText ),
'href' => $this->getContextTitle()->getLinkUrl( $cancelParams ),
'label' => new OOUI\HtmlSnippet( $this->context->msg( 'cancel' )->parse() ),
'framed' => false,
'href' => $this->getContextTitle()->getLinkUrl( $cancelParams ),
'label' => new OOUI\HtmlSnippet( $this->context->msg( 'cancel' )->parse() ),
'framed' => false,
'flags' => 'destructive',
] );
} else {
'flags' => 'destructive',
] );
} else {
'id' => $options['id'],
'name' => $name,
'selected' => $options['default'],
'id' => $options['id'],
'name' => $name,
'selected' => $options['default'],
] ),
[
'align' => 'inline',
] ),
[
'align' => 'inline',
$buttons['save'] = new OOUI\ButtonInputWidget( [
'flags' => [ 'constructive', 'primary' ],
'label' => $this->context->msg( $buttonLabelKey )->text(),
$buttons['save'] = new OOUI\ButtonInputWidget( [
'flags' => [ 'constructive', 'primary' ],
'label' => $this->context->msg( $buttonLabelKey )->text(),
'type' => 'submit',
] + $saveConfig );
} else {
'type' => 'submit',
] + $saveConfig );
} else {
$previewConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
$buttons['preview'] = new OOUI\ButtonInputWidget( [
'label' => $this->context->msg( 'showpreview' )->text(),
$previewConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
$buttons['preview'] = new OOUI\ButtonInputWidget( [
'label' => $this->context->msg( 'showpreview' )->text(),
'type' => 'submit'
] + $previewConfig );
} else {
'type' => 'submit'
] + $previewConfig );
} else {
$diffConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
$buttons['diff'] = new OOUI\ButtonInputWidget( [
'label' => $this->context->msg( 'showdiff' )->text(),
$diffConfig = OOUI\Element::configFromHtmlAttributes( $attribs );
$buttons['diff'] = new OOUI\ButtonInputWidget( [
'label' => $this->context->msg( 'showdiff' )->text(),
'type' => 'submit',
] + $diffConfig );
} else {
'type' => 'submit',
] + $diffConfig );
} else {