25 if ( !empty( $this->mParams[
'invert'] ) ) {
34 if ( $this->mClass !==
'' ) {
39 if ( isset( $attr[
'title'] ) ) {
41 $attrLabel[
'title'] = $attr[
'title'];
46 $chkDivider =
"\u{00A0}";
47 $chkLabel =
Xml::check( $this->mName, $value, $attr ) .
49 Html::rawElement(
'label', $attrLabel, $this->mLabel );
52 $chkLabelClass =
'mw-ui-checkbox';
53 $chkLabel = Html::rawElement(
55 [
'class' => $chkLabelClass ],
71 if ( !empty( $this->mParams[
'invert'] ) ) {
79 $attr += \OOUI\Element::configFromHtmlAttributes(
83 if ( $this->mClass !==
'' ) {
87 $attr[
'selected'] = $value;
90 return new \OOUI\CheckboxInputWidget( $attr );
94 if ( !empty( $this->mParams[
'invert'] ) ) {
101 $attribs += $this->
getAttributes( [
'disabled',
'tabindex' ] );
104 $inputClass = $this->mClass ??
'';
105 $attribs[
'class'] = $inputClass .
' cdx-checkbox__input';
109 $labelAttribs[
'class'] = [
'cdx-checkbox__label' ];
112 $wrapperAttribs = [
'class' => [
'cdx-checkbox' ] ];
114 $wrapperAttribs[
'class'][] =
'cdx-checkbox--status-error';
116 if ( isset( $attribs[
'title'] ) ) {
118 $wrapperAttribs[
'title'] = $attribs[
'title'];
122 $checkIcon =
"<span class=\"cdx-checkbox__icon\">\u{00A0}</span>";
123 $innerContent =
Xml::check( $this->mName, $value, $attribs ) .
125 Html::rawElement(
'label', $labelAttribs, $this->mLabel );
126 return Html::rawElement(
145 return $this->mLabel ??
'';
147 $this->mParent instanceof
HTMLForm &&
188 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
193 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
195 ? !$request->getBool( $this->mName )
196 : $request->getBool( $this->mName );
204class_alias( HTMLCheckField::class,
'HTMLCheckField' );