* @return string
*/
function getButtons() {
+ global $wgUseMediaWikiUIEverywhere;
+ $attrs = $wgUseMediaWikiUIEverywhere ? array( 'class' => 'mw-ui-button mw-ui-quiet' ) : array();
+
if ( !$this->getModifiedUser()->isAllowedAny( 'editmyprivateinfo', 'editmyoptions' ) ) {
return '';
}
if ( $this->getModifiedUser()->isAllowed( 'editmyoptions' ) ) {
$t = SpecialPage::getTitleFor( 'Preferences', 'reset' );
- $html .= "\n" . Linker::link( $t, $this->msg( 'restoreprefs' )->escaped() );
+ $html .= "\n" . Linker::link( $t, $this->msg( 'restoreprefs' )->escaped(),
+ $attrs );
$html = Xml::tags( 'div', array( 'class' => 'mw-prefs-buttons' ), $html );
}
protected $mFieldTree;
protected $mShowReset = false;
protected $mShowSubmit = true;
+ protected $mSubmitModifierClass = 'mw-ui-constructive';
protected $mSubmitCallback;
protected $mValidationErrorMessage;
$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() ) {
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
$htmlForm = new HTMLForm( array(), $context, 'prefs-restore' );
$htmlForm->setSubmitTextMsg( 'restoreprefs' );
+ $htmlForm->setSubmitDestructive();
$htmlForm->setSubmitCallback( array( $this, 'submitReset' ) );
$htmlForm->suppressReset();