23 if ( !empty( $this->mParams[
'invert'] ) ) {
28 ...$this->getTooltipAndAccessKey(),
30 ...$this->getAttributes( [
'disabled',
'tabindex' ] ),
31 'class' => $this->mClass !==
'' ? $this->mClass :
null,
32 'checked' => (bool)$value,
35 'name' => $this->mName,
39 if ( isset( $attr[
'title'] ) ) {
41 $attrLabel[
'title'] = $attr[
'title'];
44 $chkDivider =
"\u{00A0}";
47 Html::rawElement(
'label', $attrLabel, $this->mLabel );
60 if ( !empty( $this->mParams[
'invert'] ) ) {
68 $attr += \OOUI\Element::configFromHtmlAttributes(
72 if ( $this->mClass !==
'' ) {
76 $attr[
'selected'] = $value;
79 return new \OOUI\CheckboxInputWidget( $attr );
84 if ( !empty( $this->mParams[
'invert'] ) ) {
90 ...$this->getTooltipAndAccessKey(),
92 ...$this->getAttributes( [
'disabled',
'tabindex' ] ),
93 'class' => $this->mClass .
' cdx-checkbox__input',
94 'checked' => (bool)$value,
97 'name' => $this->mName,
102 $labelAttribs[
'class'] = [
'cdx-checkbox__label' ];
105 $wrapperAttribs = [
'class' => [
'cdx-checkbox' ] ];
107 $wrapperAttribs[
'class'][] =
'cdx-checkbox--status-error';
109 if ( isset( $attribs[
'title'] ) ) {
111 $wrapperAttribs[
'title'] = $attribs[
'title'];
115 $checkIcon =
"<span class=\"cdx-checkbox__icon\">\u{00A0}</span>";
118 Html::rawElement(
'label', $labelAttribs, $this->mLabel );
119 return Html::rawElement(
138 return $this->mLabel ??
'';
140 $this->mParent instanceof
HTMLForm &&
181 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
188 ? !
$request->getBool( $this->mName )
189 :
$request->getBool( $this->mName );
197class_alias( HTMLCheckField::class,
'HTMLCheckField' );