18 $useMediaWikiUIEverywhere = MediaWikiServices::getInstance()
19 ->getMainConfig()->get( MainConfigNames::UseMediaWikiUIEverywhere );
21 if ( !empty( $this->mParams[
'invert'] ) ) {
30 if ( $this->mClass !==
'' ) {
35 if ( isset( $attr[
'title'] ) ) {
37 $attrLabel[
'title'] = $attr[
'title'];
40 $chkLabel =
Xml::check( $this->mName, $value, $attr ) .
44 if ( $useMediaWikiUIEverywhere || $this->mParent instanceof
VFormHTMLForm ) {
47 [
'class' =>
'mw-ui-checkbox' ],
63 if ( !empty( $this->mParams[
'invert'] ) ) {
71 $attr += OOUI\Element::configFromHtmlAttributes(
75 if ( $this->mClass !==
'' ) {
79 $attr[
'selected'] = $value;
82 return new OOUI\CheckboxInputWidget( $attr );
99 $this->mParent instanceof
HTMLForm &&
133 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
138 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
140 ? !$request->getBool( $this->mName )
141 : $request->getBool( $this->mName );
getLabel()
For a checkbox, the label goes on the right hand side, and is added in getInputHTML(),...
loadDataFromRequest( $request)
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....
getLabelAlignOOUI()
Get label alignment when generating field for OOUI.
getInputOOUI( $value)
Get the OOUI version of this field.
needsLabel()
checkboxes don't need a label.
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
A class containing constants representing the names of configuration variables.
static check( $name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.