36 $info[
'nodata'] =
true;
40 parent::__construct( $info );
42 if ( isset( $info[
'flags'] ) ) {
43 $this->mFlags = $info[
'flags'];
46 if ( isset( $info[
'formnovalidate'] ) ) {
47 $this->mFormnovalidate = $info[
'formnovalidate'];
50 # Generate the label from a message, if possible
51 if ( isset( $info[
'buttonlabel-message'] ) ) {
52 $this->buttonLabel = $this->
getMessage( $info[
'buttonlabel-message'] )->parse();
53 } elseif ( isset( $info[
'buttonlabel'] ) ) {
54 if ( $info[
'buttonlabel'] ===
' ' || $info[
'buttonlabel'] ===
"\u{00A0}" ) {
56 $this->buttonLabel =
"\u{00A0}";
58 $this->buttonLabel = htmlspecialchars( $info[
'buttonlabel'] );
60 } elseif ( isset( $info[
'buttonlabel-raw'] ) ) {
61 $this->buttonLabel = $info[
'buttonlabel-raw'];
67 $prefix =
'mw-htmlform-';
69 $this->mParent->
getConfig()->get(
'UseMediaWikiUIEverywhere' )
73 $flags .=
' ' . $prefix .
'button';
75 foreach ( $this->mFlags as $flag ) {
76 $flags .=
' ' . $prefix . $flag;
79 'class' =>
'mw-htmlform-submit ' . $this->mClass . $flags,
88 return Html::element(
'input', $attr );
90 return Html::rawElement(
'button', $attr,
91 $this->buttonLabel ?: htmlspecialchars( $this->
getDefault() ) );
101 return new OOUI\ButtonInputWidget( [
102 'name' => $this->mName,
104 'label' => !$this->
isBadIE() && $this->buttonLabel
105 ?
new OOUI\HtmlSnippet( $this->buttonLabel )
111 'useInputTag' => $this->
isBadIE(),
112 ] + OOUI\Element::configFromHtmlAttributes(
138 $request = $this->mParent
139 ? $this->mParent->getRequest()
140 : RequestContext::getMain()->getRequest();
141 return (
bool)preg_match(
'/MSIE [1-7]\./i', $request->getHeader(
'User-Agent' ) );