Switch some HTMLForms in special pages to OOUI
[lhc/web/wiklou.git] / includes / htmlform / HTMLCheckField.php
index ede30dd..55312ff 100644 (file)
@@ -20,9 +20,15 @@ class HTMLCheckField extends HTMLFormField {
                        $attr['class'] = $this->mClass;
                }
 
-               $chkLabel = Xml::check( $this->mName, $value, $attr )
-               . ' '
-               . Html::rawElement( 'label', array( 'for' => $this->mID ), $this->mLabel );
+               $attrLabel = array( 'for' => $this->mID );
+               if ( isset( $attr['title'] ) ) {
+                       // propagate tooltip to label
+                       $attrLabel['title'] = $attr['title'];
+               }
+
+               $chkLabel = Xml::check( $this->mName, $value, $attr ) .
+                       ' ' .
+                       Html::rawElement( 'label', $attrLabel, $this->mLabel );
 
                if ( $wgUseMediaWikiUIEverywhere || $this->mParent instanceof VFormHTMLForm ) {
                        $chkLabel = Html::rawElement(
@@ -74,6 +80,11 @@ class HTMLCheckField extends HTMLFormField {
        function getLabel() {
                if ( $this->mParent instanceof OOUIHTMLForm ) {
                        return $this->mLabel;
+               } elseif (
+                       $this->mParent instanceof HTMLForm &&
+                       $this->mParent->getDisplayFormat() === 'div'
+               ) {
+                       return '';
                } else {
                        return ' ';
                }