Merge "Correct API documentation for action=parse&prop=headhtml"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index d3b5db7..82cbb40 100644 (file)
@@ -81,9 +81,6 @@ use Wikimedia\ObjectFactory;
  *    'help-inline'         -- Whether help text (defined using options above) will be shown
  *                             inline after the input field, rather than in a popup.
  *                             Defaults to true. Only used by OOUI form fields.
- *    'notice'              -- (deprecated, use 'help' instead)
- *    'notice-messages'     -- (deprecated, use 'help-messages' instead)
- *    'notice-message'      -- (deprecated, use 'help-message' instead)
  *    'required'            -- passed through to the object, indicating that it
  *                             is a required field.
  *    'size'                -- the length of text fields
@@ -162,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,
@@ -176,6 +174,7 @@ class HTMLForm extends ContextSource {
                'user' => HTMLUserTextField::class,
                'usersmultiselect' => HTMLUsersMultiselectField::class,
                'titlesmultiselect' => HTMLTitlesMultiselectField::class,
+               'namespacesmultiselect' => HTMLNamespacesMultiselectField::class,
        ];
 
        public $mFieldData;
@@ -347,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] = [];
                                        }
@@ -1288,7 +1283,7 @@ class HTMLForm extends ContextSource {
                        if ( $status->isGood() ) {
                                $elementstr = '';
                        } else {
-                               $elementstr = $this->getOutput()->parse(
+                               $elementstr = $this->getOutput()->parseAsInterface(
                                        $status->getWikiText()
                                );
                        }