jenkins-bot has submitted this change and it was merged.

Change subject: Fix regression: Allow HTML as checkbox label in HTMLCheckField
......................................................................


Fix regression: Allow HTML as checkbox label in HTMLCheckField

Follow-up to aa15d5287d898b624a30a70d14e495899f7d251e

Change-Id: Ie9a6b3f017912d0f3493da09a267cf32852392af
---
M includes/htmlform/HTMLCheckField.php
1 file changed, 15 insertions(+), 1 deletion(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/htmlform/HTMLCheckField.php 
b/includes/htmlform/HTMLCheckField.php
index 4eb7e6e..5f70362 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 @@
                                ),
                                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;
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/156015
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9a6b3f017912d0f3493da09a267cf32852392af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.24wmf18
Gerrit-Owner: Alex Monk <kren...@wikimedia.org>
Gerrit-Reviewer: Alex Monk <kren...@wikimedia.org>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: GeorgeBarnick <georgebarn...@gmail.com>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to