37 $info[
'nodata'] =
true;
41 parent::__construct( $info );
43 if ( isset( $info[
'flags'] ) ) {
44 $this->mFlags = $info[
'flags'];
47 if ( isset( $info[
'formnovalidate'] ) ) {
48 $this->mFormnovalidate = $info[
'formnovalidate'];
51 # Generate the label from a message, if possible
52 if ( isset( $info[
'buttonlabel-message'] ) ) {
53 $this->buttonLabel = $this->
getMessage( $info[
'buttonlabel-message'] )->parse();
54 } elseif ( isset( $info[
'buttonlabel'] ) ) {
55 if ( $info[
'buttonlabel'] ===
' ' || $info[
'buttonlabel'] ===
"\u{00A0}" ) {
57 $this->buttonLabel =
"\u{00A0}";
59 $this->buttonLabel = htmlspecialchars( $info[
'buttonlabel'] );
61 } elseif ( isset( $info[
'buttonlabel-raw'] ) ) {
62 $this->buttonLabel = $info[
'buttonlabel-raw'];
68 $prefix =
'mw-htmlform-';
70 $this->mParent->
getConfig()->get(
'UseMediaWikiUIEverywhere' )
74 $flags .=
' ' . $prefix .
'button';
76 foreach ( $this->mFlags as $flag ) {
77 $flags .=
' ' . $prefix . $flag;
80 'class' =>
'mw-htmlform-submit ' . $this->mClass . $flags,
89 return Html::element(
'input', $attr );
91 return Html::rawElement(
'button', $attr,
92 $this->buttonLabel ?: htmlspecialchars( $this->
getDefault() ) );
103 return new OOUI\ButtonInputWidget( [
104 'name' => $this->mName,
106 'label' => !$this->
isBadIE() && $this->buttonLabel
107 ?
new OOUI\HtmlSnippet( $this->buttonLabel )
113 'useInputTag' => $this->
isBadIE(),
114 ] + OOUI\Element::configFromHtmlAttributes(
145 $request = $this->mParent
146 ? $this->mParent->getRequest()
147 : RequestContext::getMain()->getRequest();
148 return (
bool)preg_match(
'/MSIE [1-7]\./i', $request->getHeader(
'User-Agent' ) );