17 $useMediaWikiUIEverywhere =
false;
18 if ( $this->mParent ) {
19 $useMediaWikiUIEverywhere = $this->mParent->getConfig()->get( MainConfigNames::UseMediaWikiUIEverywhere );
22 if ( !empty( $this->mParams[
'invert'] ) ) {
31 if ( $this->mClass !==
'' ) {
36 if ( isset( $attr[
'title'] ) ) {
38 $attrLabel[
'title'] = $attr[
'title'];
41 $chkLabel = Xml::check( $this->mName, $value, $attr ) .
43 Html::rawElement(
'label', $attrLabel, $this->mLabel );
45 if ( $useMediaWikiUIEverywhere || $this->mParent instanceof
VFormHTMLForm ) {
46 $chkLabel = Html::rawElement(
48 [
'class' =>
'mw-ui-checkbox' ],
64 if ( !empty( $this->mParams[
'invert'] ) ) {
72 $attr += OOUI\Element::configFromHtmlAttributes(
76 if ( $this->mClass !==
'' ) {
80 $attr[
'selected'] = $value;
83 return new OOUI\CheckboxInputWidget( $attr );
100 $this->mParent instanceof
HTMLForm &&
134 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
139 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
141 ? !$request->getBool( $this->mName )
142 : $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.
A class containing constants representing the names of configuration variables.