24 if ( !empty( $this->mParams[
'invert'] ) ) {
29 ...$this->getTooltipAndAccessKey(),
31 ...$this->getAttributes( [
'disabled',
'tabindex' ] ),
32 'class' => $this->mClass !==
'' ? $this->mClass :
null,
33 'checked' => (bool)$value,
36 'name' => $this->mName,
40 if ( isset( $attr[
'title'] ) ) {
42 $attrLabel[
'title'] = $attr[
'title'];
47 $chkDivider =
"\u{00A0}";
50 Html::rawElement(
'label', $attrLabel, $this->mLabel );
53 $chkLabelClass =
'mw-ui-checkbox';
54 $chkLabel = Html::rawElement(
56 [
'class' => $chkLabelClass ],
72 if ( !empty( $this->mParams[
'invert'] ) ) {
80 $attr += \OOUI\Element::configFromHtmlAttributes(
84 if ( $this->mClass !==
'' ) {
88 $attr[
'selected'] = $value;
91 return new \OOUI\CheckboxInputWidget( $attr );
96 if ( !empty( $this->mParams[
'invert'] ) ) {
102 ...$this->getTooltipAndAccessKey(),
104 ...$this->getAttributes( [
'disabled',
'tabindex' ] ),
105 'class' => $this->mClass .
' cdx-checkbox__input',
106 'checked' => (bool)$value,
107 'type' =>
'checkbox',
109 'name' => $this->mName,
114 $labelAttribs[
'class'] = [
'cdx-checkbox__label' ];
117 $wrapperAttribs = [
'class' => [
'cdx-checkbox' ] ];
119 $wrapperAttribs[
'class'][] =
'cdx-checkbox--status-error';
121 if ( isset( $attribs[
'title'] ) ) {
123 $wrapperAttribs[
'title'] = $attribs[
'title'];
127 $checkIcon =
"<span class=\"cdx-checkbox__icon\">\u{00A0}</span>";
130 Html::rawElement(
'label', $labelAttribs, $this->mLabel );
131 return Html::rawElement(
150 return $this->mLabel ??
'';
152 $this->mParent instanceof
HTMLForm &&
193 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
198 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
200 ? !$request->getBool( $this->mName )
201 : $request->getBool( $this->mName );
209class_alias( HTMLCheckField::class,
'HTMLCheckField' );