Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging...
[lhc/web/wiklou.git] / includes / HTMLForm.php
index c7cf929..ec038c9 100644 (file)
@@ -318,9 +318,9 @@ class HTMLForm {
         * Add header text, inside the form.
         * @param $msg String complete text of message to display
         */
-       function addHeaderText( $msg, $section = null ) { 
+       function addHeaderText( $msg, $section = null ) {
                if ( is_null( $section ) ) {
-                       $this->mHeader .= $msg; 
+                       $this->mHeader .= $msg;
                } else {
                        if ( !isset( $this->mSectionHeaders[$section] ) ) {
                                $this->mSectionHeaders[$section] = '';
@@ -333,14 +333,14 @@ class HTMLForm {
         * Add footer text, inside the form.
         * @param $msg String complete text of message to display
         */
-       function addFooterText( $msg, $section = null ) { 
+       function addFooterText( $msg, $section = null ) {
                if ( is_null( $section ) ) {
-                       $this->mFooter .= $msg; 
+                       $this->mFooter .= $msg;
                } else {
                        if ( !isset( $this->mSectionFooters[$section] ) ) {
                                $this->mSectionFooters[$section] = '';
                        }
-                       $this->mSectionFooters[$section] .= $msg;                       
+                       $this->mSectionFooters[$section] .= $msg;
                }
        }
 
@@ -582,7 +582,8 @@ class HTMLForm {
 
        /**
         * Set the id for the submit button.
-        * @param $t String.  FIXME: Integrity is *not* validated
+        * @param $t String.
+        * @todo FIXME: Integrity of $t is *not* validated
         */
        function setSubmitID( $t ) {
                $this->mSubmitID = $t;
@@ -692,11 +693,11 @@ class HTMLForm {
                                $legend = $this->getLegend( $key );
                                if ( isset( $this->mSectionHeaders[$key] ) ) {
                                        $section = $this->mSectionHeaders[$key] . $section;
-                               } 
+                               }
                                if ( isset( $this->mSectionFooters[$key] ) ) {
                                        $section .= $this->mSectionFooters[$key];
                                }
-                               $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n";                                   
+                               $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n";
                        }
                }
 
@@ -972,23 +973,20 @@ abstract class HTMLFormField {
                $helptext = null;
 
                if ( isset( $this->mParams['help-message'] ) ) {
-                       $msg = $this->mParams['help-message'];
-                       $helptext = wfMsgExt( $msg, 'parseinline' );
-                       if ( wfEmptyMsg( $msg ) ) {
-                               # Never mind
-                               $helptext = null;
+                       $msg = wfMessage( $this->mParams['help-message'] );
+                       if ( $msg->exists() ) {
+                               $helptext = $msg->parse();
                        }
                } elseif ( isset( $this->mParams['help-messages'] ) ) {
                        # help-message can be passed a message key (string) or an array containing
                        # a message key and additional parameters. This makes it impossible to pass
                        # an array of message key
-                       foreach( $this->mParams['help-messages'] as $msg ) {
-                               $candidate = wfMsgExt( $msg, 'parseinline' );
-                               if( wfEmptyMsg( $msg ) ) {
-                                       $candidate = null;
+                       foreach( $this->mParams['help-messages'] as $name ) {
+                               $msg = wfMessage( $name );
+                               if( $msg->exists() ) {
+                                       $helptext .= $msg->parse(); // append message
                                }
-                               $helptext .= $candidate; // append message
-                       }       
+                       }
                } elseif ( isset( $this->mParams['help'] ) ) {
                        $helptext = $this->mParams['help'];
                }
@@ -1346,7 +1344,7 @@ class HTMLSelectField extends HTMLFormField {
                # If one of the options' 'name' is int(0), it is automatically selected.
                # because PHP sucks and thinks int(0) == 'some string'.
                # Working around this by forcing all of them to strings.
-               foreach( $this->mParams['options'] as $key => &$opt ){
+               foreach( $this->mParams['options'] as &$opt ){
                        if( is_int( $opt ) ){
                                $opt = strval( $opt );
                        }
@@ -1535,7 +1533,8 @@ class HTMLMultiSelectField extends HTMLFormField {
                        # field, is it because the user has not yet submitted the form, or that they
                        # have submitted it with all the options unchecked? We will have to assume the
                        # latter, which basically means that you can't specify 'positive' defaults
-                       # for GET forms.  FIXME...
+                       # for GET forms.
+                       # @todo FIXME...
                        return $request->getArray( $this->mName, array() );
                }
        }
@@ -1562,7 +1561,7 @@ class HTMLMultiSelectField extends HTMLFormField {
  * Plus a text field underneath for an additional reason.  The 'value' of the field is
  * ""<select>: <extra reason>"", or "<extra reason>" if nothing has been selected in the
  * select dropdown.
- * FIXME: If made 'required', only the text field should be compulsory.
+ * @todo FIXME: If made 'required', only the text field should be compulsory.
  */
 class HTMLSelectAndOtherField extends HTMLSelectField {
 
@@ -1887,8 +1886,8 @@ class HTMLEditTools extends HTMLFormField {
                        }
                }
                $msg->inContentLanguage();
-               
-               
+
+
                return '<tr><td></td><td class="mw-input">'
                        . '<div class="mw-editTools">'
                        . $msg->parseAsBlock()