From: Matthew Flaschen Date: Sun, 24 Aug 2014 01:12:26 +0000 (-0400) Subject: Fix regression: Allow HTML as checkbox label in HTMLCheckField X-Git-Tag: 1.31.0-rc.0~14297 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=9b0481bb63ff1bb3cf4b95d93a77fefcabc3247e;p=lhc%2Fweb%2Fwiklou.git Fix regression: Allow HTML as checkbox label in HTMLCheckField Follow-up to aa15d5287d898b624a30a70d14e495899f7d251e Change-Id: Ie9a6b3f017912d0f3493da09a267cf32852392af --- diff --git a/includes/htmlform/HTMLCheckField.php b/includes/htmlform/HTMLCheckField.php index 4eb7e6ef96..5f70362a5a 100644 --- a/includes/htmlform/HTMLCheckField.php +++ b/includes/htmlform/HTMLCheckField.php @@ -5,6 +5,8 @@ */ class HTMLCheckField extends HTMLFormField { function getInputHTML( $value ) { + global $wgUseMediaWikiUIEverywhere; + if ( !empty( $this->mParams['invert'] ) ) { $value = !$value; } @@ -26,7 +28,19 @@ class HTMLCheckField extends HTMLFormField { ), Xml::check( $this->mName, $value, $attr ) . $this->mLabel ); } else { - return Xml::checkLabel( $this->mLabel, $this->mName, $this->mID, $value, $attr ); + $chkLabel = Xml::check( $this->mName, $value, $attr ) + . ' ' + . Html::rawElement( 'label', array( 'for' => $this->mID ), $this->mLabel ); + + if ( $wgUseMediaWikiUIEverywhere ) { + $chkLabel = Html::rawElement( + 'div', + array( 'class' => 'mw-ui-checkbox' ), + $chkLabel + ); + } + + return $chkLabel; } }