Merge "Document nodata for HTMLFormFields"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 91f4fb2..043e0f6 100644 (file)
@@ -162,6 +162,7 @@ class HTMLForm extends ContextSource {
                'date' => HTMLDateTimeField::class,
                'time' => HTMLDateTimeField::class,
                'datetime' => HTMLDateTimeField::class,
+               'expiry' => HTMLExpiryField::class,
                // HTMLTextField will output the correct type="" attribute automagically.
                // There are about four zillion other HTML5 input types, like range, but
                // we don't use those at the moment, so no point in adding all of them.
@@ -433,17 +434,6 @@ class HTMLForm extends ContextSource {
                return $this->displayFormat;
        }
 
-       /**
-        * Test if displayFormat is 'vform'
-        * @since 1.22
-        * @deprecated since 1.25
-        * @return bool
-        */
-       public function isVForm() {
-               wfDeprecated( __METHOD__, '1.25' );
-               return false;
-       }
-
        /**
         * Get the HTMLFormField subclass for this descriptor.
         *
@@ -507,7 +497,7 @@ class HTMLForm extends ContextSource {
        /**
         * Prepare form for submission.
         *
-        * @attention When doing method chaining, that should be the very last
+        * @warning When doing method chaining, that should be the very last
         * method call before displayForm().
         *
         * @throws MWException
@@ -1009,7 +999,7 @@ class HTMLForm extends ContextSource {
         * Display the form (sending to the context's OutputPage object), with an
         * appropriate error message or stack of messages, and any validation errors, etc.
         *
-        * @attention You should call prepareForm() before calling this function.
+        * @warning You should call prepareForm() before calling this function.
         * Moreover, when doing method chaining this should be the very last method
         * call just after prepareForm().
         *
@@ -1350,10 +1340,13 @@ class HTMLForm extends ContextSource {
        /**
         * Identify that the submit button in the form has a progressive action
         * @since 1.25
+        * @deprecated since 1.32, No need to call. Submit button already
+        * has a progressive action form.
         *
         * @return HTMLForm $this for chaining calls (since 1.28)
         */
        public function setSubmitProgressive() {
+               wfDeprecated( __METHOD__, '1.32' );
                $this->mSubmitFlags = [ 'progressive', 'primary' ];
 
                return $this;
@@ -1614,9 +1607,10 @@ class HTMLForm extends ContextSource {
         * @param string $legend Legend text for the fieldset
         * @param string $section The section content in plain Html
         * @param array $attributes Additional attributes for the fieldset
+        * @param bool $isRoot Section is at the root of the tree
         * @return string The fieldset's Html
         */
-       protected function wrapFieldSetSection( $legend, $section, $attributes ) {
+       protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
                return Xml::fieldset( $legend, $section, $attributes ) . "\n";
        }
 
@@ -1699,7 +1693,9 @@ class HTMLForm extends ContextSource {
                                        if ( $fieldsetIDPrefix ) {
                                                $attributes['id'] = Sanitizer::escapeIdForAttribute( "$fieldsetIDPrefix$key" );
                                        }
-                                       $subsectionHtml .= $this->wrapFieldSetSection( $legend, $section, $attributes );
+                                       $subsectionHtml .= $this->wrapFieldSetSection(
+                                               $legend, $section, $attributes, $fields === $this->mFieldTree
+                                       );
                                } else {
                                        // Just return the inputs, nothing fancy.
                                        $subsectionHtml .= $section;