24 if ( !empty( $this->mParams[
'invert'] ) ) {
33 if ( $this->mClass !==
'' ) {
38 if ( isset( $attr[
'title'] ) ) {
40 $attrLabel[
'title'] = $attr[
'title'];
45 $chkDivider =
"\u{00A0}";
46 $chkLabel = Html::check( $this->mName, $value, $attr ) .
48 Html::rawElement(
'label', $attrLabel, $this->mLabel );
51 $chkLabelClass =
'mw-ui-checkbox';
52 $chkLabel = Html::rawElement(
54 [
'class' => $chkLabelClass ],
70 if ( !empty( $this->mParams[
'invert'] ) ) {
78 $attr += \OOUI\Element::configFromHtmlAttributes(
82 if ( $this->mClass !==
'' ) {
86 $attr[
'selected'] = $value;
89 return new \OOUI\CheckboxInputWidget( $attr );
93 if ( !empty( $this->mParams[
'invert'] ) ) {
100 $attribs += $this->
getAttributes( [
'disabled',
'tabindex' ] );
103 $inputClass = $this->mClass ??
'';
104 $attribs[
'class'] = $inputClass .
' cdx-checkbox__input';
108 $labelAttribs[
'class'] = [
'cdx-checkbox__label' ];
111 $wrapperAttribs = [
'class' => [
'cdx-checkbox' ] ];
113 $wrapperAttribs[
'class'][] =
'cdx-checkbox--status-error';
115 if ( isset( $attribs[
'title'] ) ) {
117 $wrapperAttribs[
'title'] = $attribs[
'title'];
121 $checkIcon =
"<span class=\"cdx-checkbox__icon\">\u{00A0}</span>";
122 $innerContent = Html::check( $this->mName, $value, $attribs ) .
124 Html::rawElement(
'label', $labelAttribs, $this->mLabel );
125 return Html::rawElement(
144 return $this->mLabel ??
'';
146 $this->mParent instanceof
HTMLForm &&
187 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
192 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
194 ? !$request->getBool( $this->mName )
195 : $request->getBool( $this->mName );
203class_alias( HTMLCheckField::class,
'HTMLCheckField' );