+ protected function getOneCheckbox( $checked, $attribs, $label ) {
+ if ( $this->mParent instanceof OOUIHTMLForm ) {
+ if ( $this->mOptionsLabelsNotFromMessage ) {
+ $label = new OOUI\HtmlSnippet( $label );
+ }
+ return new OOUI\FieldLayout(
+ new OOUI\CheckboxInputWidget( [
+ 'name' => "{$this->mName}[]",
+ 'selected' => $checked,
+ ] + OOUI\Element::configFromHtmlAttributes(
+ $attribs
+ ) ),
+ [
+ 'label' => $label,
+ 'align' => 'inline',
+ ]
+ );
+ } else {
+ $elementFunc = [ 'Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ];
+ $checkbox =
+ Xml::check( "{$this->mName}[]", $checked, $attribs ) .
+ ' ' .
+ call_user_func( $elementFunc,
+ 'label',
+ [ 'for' => $attribs['id'] ],
+ $label
+ );
+ if ( $this->mParent->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
+ $checkbox = Html::openElement( 'div', [ 'class' => 'mw-ui-checkbox' ] ) .
+ $checkbox .
+ Html::closeElement( 'div' );
+ }
+ return $checkbox;
+ }
+ }
+