Go to the documentation of this file.
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,
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 )
109 'type' => $this->buttonType,
110 'classes' => [
'mw-htmlform-submit', $this->mClass ],
112 'flags' => $this->mFlags,
113 'useInputTag' => $this->
isBadIE(),
114 ] + OOUI\Element::configFromHtmlAttributes(
145 $request = $this->mParent
146 ? $this->mParent->getRequest()
148 return (
bool)preg_match(
'/MSIE [1-7]\./i', $request->getHeader(
'User-Agent' ) );
static getMain()
Get the RequestContext object associated with the main request.
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).