Flags added to a button or submit field in a non-OOUI form will be
handled now, too.
With activated wgUseMediaWikiUIEverywhere:
All flags will get the 'mw-ui-' prefix.
(mw-ui-button is added to the button automatically)
With deactivated wgUseMediaWikiUIEverywhere:
All flags will get the 'mw-htmlform-' prefix.
This allows HTMLForm users to add flags to only the button, without
setting them as a cssclas, which would be added to the wrapper elements,
too.
Bug: T102838
Change-Id: I121a966fb4db6649a6e1012187148d354b5534f0
}
public function getInputHTML( $value ) {
+ $flags = '';
+ $prefix = 'mw-htmlform-';
+ if ( $this->mParent instanceof VFormHTMLForm ||
+ $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' )
+ ) {
+ $prefix = 'mw-ui-';
+ // add mw-ui-button separately, so the descriptor doesn't need to set it
+ $flags .= $prefix.'button';
+ }
+ foreach ( $this->mFlags as $flag ) {
+ $flags .= ' ' . $prefix . $flag;
+ }
$attr = array(
- 'class' => 'mw-htmlform-submit ' . $this->mClass,
+ 'class' => 'mw-htmlform-submit ' . $this->mClass . $flags,
'id' => $this->mID,
) + $this->getAttributes( array( 'disabled', 'tabindex' ) );