Merge "Turn HTMLBlockedUsersItemSelect into HTMLSelectLimitField"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 509f489..ed9e7fe 100644 (file)
@@ -50,6 +50,7 @@
  *    'default'             -- default value when the form is displayed
  *    'id'                  -- HTML id attribute
  *    'cssclass'            -- CSS class
+ *    'csshelpclass'        -- CSS class used to style help text
  *    'options'             -- associative array mapping labels to values.
  *                             Some field types support multi-level arrays.
  *    'options-messages'    -- associative array mapping message keys to values.
@@ -352,7 +353,7 @@ class HTMLForm extends ContextSource {
         * @param array $descriptor Input Descriptor, as described above
         *
         * @throws MWException
-        * @return HTMLFormField subclass
+        * @return HTMLFormField Instance of a subclass of HTMLFormField
         */
        public static function loadInputFromParameters( $fieldname, $descriptor ) {
                $class = self::getClassFromDescriptor( $fieldname, $descriptor );
@@ -622,7 +623,7 @@ class HTMLForm extends ContextSource {
        /**
         * Add footer text, inside the form.
         *
-        * @param string $msg complete text of message to display
+        * @param string $msg Complete text of message to display
         * @param string|null $section The section to add the footer text to
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
@@ -741,8 +742,8 @@ class HTMLForm extends ContextSource {
         * Only useful when the method is "post".
         *
         * @since 1.24
-        * @param string|array Salt to use
-        * @return HTMLForm $this for chaining calls
+        * @param string|array $salt Salt to use
+        * @return HTMLForm $this For chaining calls
         */
        public function setTokenSalt( $salt ) {
                $this->mTokenSalt = $salt;
@@ -760,7 +761,7 @@ class HTMLForm extends ContextSource {
         *
         * @param bool|string|array|Status $submitResult Output from HTMLForm::trySubmit()
         *
-        * @return Nothing, should be last call
+        * @return void Nothing, should be last call
         */
        function displayForm( $submitResult ) {
                $this->getOutput()->addHTML( $this->getHTML( $submitResult ) );
@@ -980,7 +981,7 @@ class HTMLForm extends ContextSource {
        /**
         * Format a stack of error messages into a single HTML string
         *
-        * @param array $errors of message keys/values
+        * @param array $errors Array of message keys/values
         *
         * @return string HTML, a "<ul>" list of errors
         */
@@ -1010,7 +1011,7 @@ class HTMLForm extends ContextSource {
        /**
         * Set the text for the submit button
         *
-        * @param string $t plaintext.
+        * @param string $t Plaintext
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
         */
@@ -1024,12 +1025,15 @@ class HTMLForm extends ContextSource {
         * Set the text for the submit button to a message
         * @since 1.19
         *
-        * @param string $msg Message key
+        * @param string|Message $msg Message key or Message object
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
         */
        public function setSubmitTextMsg( $msg ) {
-               $this->setSubmitText( $this->msg( $msg )->text() );
+               if ( !$msg instanceof Message ) {
+                       $msg = $this->msg( $msg );
+               }
+               $this->setSubmitText( $msg->text() );
 
                return $this;
        }
@@ -1143,12 +1147,15 @@ class HTMLForm extends ContextSource {
         * this message as its "<legend>" element.
         * @since 1.19
         *
-        * @param string $msg Message key
+        * @param string|Message $msg Message key or Message object
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
         */
        public function setWrapperLegendMsg( $msg ) {
-               $this->setWrapperLegend( $this->msg( $msg )->text() );
+               if ( !$msg instanceof Message ) {
+                       $msg = $this->msg( $msg );
+               }
+               $this->setWrapperLegend( $msg->text() );
 
                return $this;
        }
@@ -1370,7 +1377,7 @@ class HTMLForm extends ContextSource {
         *
         * @param array $data
         *
-        * @return
+        * @return array
         */
        function filterDataForSubmit( $data ) {
                return $data;