protected $mFieldTree;
protected $mShowReset = false;
protected $mShowSubmit = true;
+ protected $mSubmitModifierClass = 'mw-ui-constructive';
protected $mSubmitCallback;
protected $mValidationErrorMessage;
if ( !empty( $field->mParams['nodata'] ) ) {
continue;
}
+ if ( $field->isHidden( $this->mFieldData ) ) {
+ continue;
+ }
if ( $field->validate(
$this->mFieldData[$fieldname],
$this->mFieldData )
$attribs['class'] = array( 'mw-htmlform-submit' );
if ( $this->isVForm() || $useMediaWikiUIEverywhere ) {
- array_push( $attribs['class'], 'mw-ui-button', 'mw-ui-constructive' );
+ array_push( $attribs['class'], 'mw-ui-button', $this->mSubmitModifierClass );
}
if ( $this->isVForm() ) {
$attrs['id'] = $button['id'];
}
- if ( $useMediaWikiUIEverywhere ) {
+ if ( $this->isVForm() || $useMediaWikiUIEverywhere ) {
if ( isset( $attrs['class'] ) ) {
$attrs['class'] .= ' mw-ui-button';
} else {
$attrs['class'] = 'mw-ui-button';
}
+ if ( $this->isVForm() ) {
+ $attrs['class'] .= ' mw-ui-big mw-ui-block';
+ }
}
$buttons .= Html::element( 'input', $attrs ) . "\n";
return $this;
}
+ /**
+ * Identify that the submit button in the form has a destructive action
+ *
+ */
+ public function setSubmitDestructive() {
+ $this->mSubmitModifierClass = 'mw-ui-destructive';
+ }
+
/**
* Set the text for the submit button to a message
* @since 1.19