Merge "Change name of main page in Sardinian (sc)"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index c6882c4..ee0da7b 100644 (file)
@@ -159,6 +159,7 @@ class HTMLForm extends ContextSource {
                'checkmatrix' => HTMLCheckMatrix::class,
                'cloner' => HTMLFormFieldCloner::class,
                'autocompleteselect' => HTMLAutoCompleteSelectField::class,
+               'language' => HTMLSelectLanguageField::class,
                'date' => HTMLDateTimeField::class,
                'time' => HTMLDateTimeField::class,
                'datetime' => HTMLDateTimeField::class,
@@ -173,6 +174,7 @@ class HTMLForm extends ContextSource {
                'user' => HTMLUserTextField::class,
                'usersmultiselect' => HTMLUsersMultiselectField::class,
                'titlesmultiselect' => HTMLTitlesMultiselectField::class,
+               'namespacesmultiselect' => HTMLNamespacesMultiselectField::class,
        ];
 
        public $mFieldData;
@@ -344,11 +346,7 @@ class HTMLForm extends ContextSource {
 
                        $setSection =& $loadedDescriptor;
                        if ( $section ) {
-                               $sectionParts = explode( '/', $section );
-
-                               while ( count( $sectionParts ) ) {
-                                       $newName = array_shift( $sectionParts );
-
+                               foreach ( explode( '/', $section ) as $newName ) {
                                        if ( !isset( $setSection[$newName] ) ) {
                                                $setSection[$newName] = [];
                                        }
@@ -607,7 +605,7 @@ class HTMLForm extends ContextSource {
                $valid = true;
                $hoistedErrors = Status::newGood();
                if ( $this->mValidationErrorMessage ) {
-                       foreach ( (array)$this->mValidationErrorMessage as $error ) {
+                       foreach ( $this->mValidationErrorMessage as $error ) {
                                $hoistedErrors->fatal( ...$error );
                        }
                } else {
@@ -702,8 +700,8 @@ class HTMLForm extends ContextSource {
        /**
         * Set a message to display on a validation error.
         *
-        * @param string|array $msg String or Array of valid inputs to wfMessage()
-        *     (so each entry can be either a String or Array)
+        * @param array $msg Array of valid inputs to wfMessage()
+        *     (so each entry must itself be an array of arguments)
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
         */
@@ -1285,7 +1283,7 @@ class HTMLForm extends ContextSource {
                        if ( $status->isGood() ) {
                                $elementstr = '';
                        } else {
-                               $elementstr = $this->getOutput()->parse(
+                               $elementstr = $this->getOutput()->parseAsInterface(
                                        $status->getWikiText()
                                );
                        }