Fix display of inverted check fields in HTML forms -- fixes bug 18581.
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 27 Apr 2009 00:55:23 +0000 (00:55 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 27 Apr 2009 00:55:23 +0000 (00:55 +0000)
includes/HTMLForm.php

index f77ff4c..a2be6cc 100644 (file)
@@ -525,6 +525,9 @@ class HTMLIntField extends HTMLTextField {
 
 class HTMLCheckField extends HTMLFormField {
        function getInputHTML( $value ) {
+               if ( !empty( $this->mParams['invert'] ) )
+                       $value = !$value;
+               
                return Xml::check( $this->mName, $value, array( 'id' => $this->mID ) ) . '&nbsp;' .
                                Xml::tags( 'label', array( 'for' => $this->mID ), $this->mLabel );
        }