Merge "Fix type to callable on FileRepo::getErrorCleanupFunction"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index e5330b6..acf64db 100644 (file)
@@ -221,6 +221,20 @@ class HTMLForm extends ContextSource {
         */
        protected $mAction = false;
 
+       /**
+        * Whether the form can be collapsed
+        * @since 1.34
+        * @var bool
+        */
+       protected $mCollapsible = false;
+
+       /**
+        * Whether the form is collapsed by default
+        * @since 1.34
+        * @var bool
+        */
+       protected $mCollapsed = false;
+
        /**
         * Form attribute autocomplete. A typical value is "off". null does not set the attribute
         * @since 1.27
@@ -1047,6 +1061,19 @@ class HTMLForm extends ContextSource {
                return '' . $this->mPre . $html . $this->mPost;
        }
 
+       /**
+        * Enable collapsible mode, and set whether the form is collapsed by default.
+        *
+        * @since 1.34
+        * @param bool $collapsedByDefault Whether the form is collapsed by default (optional).
+        * @return HTMLForm $this for chaining calls
+        */
+       public function setCollapsibleOptions( $collapsedByDefault = false ) {
+               $this->mCollapsible = true;
+               $this->mCollapsed = $collapsedByDefault;
+               return $this;
+       }
+
        /**
         * Get HTML attributes for the `<form>` tag.
         * @return array
@@ -1250,20 +1277,6 @@ class HTMLForm extends ContextSource {
                return $this->displaySection( $this->mFieldTree, $this->mTableId );
        }
 
-       /**
-        * Format and display an error message stack.
-        *
-        * @param string|array|Status $errors
-        *
-        * @deprecated since 1.28, use getErrorsOrWarnings() instead
-        *
-        * @return string
-        */
-       public function getErrors( $errors ) {
-               wfDeprecated( __METHOD__ );
-               return $this->getErrorsOrWarnings( $errors, 'error' );
-       }
-
        /**
         * Returns a formatted list of errors or warnings from the given elements.
         *
@@ -1346,21 +1359,6 @@ class HTMLForm extends ContextSource {
                return $this;
        }
 
-       /**
-        * 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;
-       }
-
        /**
         * Set the text for the submit button to a message
         * @since 1.19