18 $useMediaWikiUIEverywhere =
false;
19 if ( $this->mParent ) {
20 $useMediaWikiUIEverywhere = $this->mParent->getConfig()->get( MainConfigNames::UseMediaWikiUIEverywhere );
23 if ( !empty( $this->mParams[
'invert'] ) ) {
32 if ( $this->mClass !==
'' ) {
37 if ( isset( $attr[
'title'] ) ) {
39 $attrLabel[
'title'] = $attr[
'title'];
42 $chkLabel = Xml::check( $this->mName, $value, $attr ) .
44 Html::rawElement(
'label', $attrLabel, $this->mLabel );
46 if ( $useMediaWikiUIEverywhere || $this->mParent instanceof
VFormHTMLForm ) {
47 $chkLabel = Html::rawElement(
49 [
'class' =>
'mw-ui-checkbox' ],
65 if ( !empty( $this->mParams[
'invert'] ) ) {
73 $attr += OOUI\Element::configFromHtmlAttributes(
77 if ( $this->mClass !==
'' ) {
81 $attr[
'selected'] = $value;
84 return new OOUI\CheckboxInputWidget( $attr );
101 $this->mParent instanceof
HTMLForm &&
142 $invert = isset( $this->mParams[
'invert'] ) && $this->mParams[
'invert'];
147 if ( $this->
isSubmitAttempt( $request ) || $request->getCheck( $this->mName ) ) {
149 ? !$request->getBool( $this->mName )
150 : $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.