Merge "Implement HTMLComboboxField"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 24 Nov 2015 19:20:07 +0000 (19:20 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 24 Nov 2015 19:20:07 +0000 (19:20 +0000)
1  2 
autoload.php
includes/htmlform/HTMLForm.php

diff --combined autoload.php
@@@ -36,13 -36,16 +36,13 @@@ $wgAutoloadLocalClasses = array
        'ApiFeedWatchlist' => __DIR__ . '/includes/api/ApiFeedWatchlist.php',
        'ApiFileRevert' => __DIR__ . '/includes/api/ApiFileRevert.php',
        'ApiFormatBase' => __DIR__ . '/includes/api/ApiFormatBase.php',
 -      'ApiFormatDbg' => __DIR__ . '/includes/api/ApiFormatDbg.php',
        'ApiFormatFeedWrapper' => __DIR__ . '/includes/api/ApiFormatFeedWrapper.php',
        'ApiFormatJson' => __DIR__ . '/includes/api/ApiFormatJson.php',
        'ApiFormatNone' => __DIR__ . '/includes/api/ApiFormatNone.php',
        'ApiFormatPhp' => __DIR__ . '/includes/api/ApiFormatPhp.php',
        'ApiFormatRaw' => __DIR__ . '/includes/api/ApiFormatRaw.php',
 -      'ApiFormatTxt' => __DIR__ . '/includes/api/ApiFormatTxt.php',
        'ApiFormatXml' => __DIR__ . '/includes/api/ApiFormatXml.php',
        'ApiFormatXmlRsd' => __DIR__ . '/includes/api/ApiRsd.php',
 -      'ApiFormatYaml' => __DIR__ . '/includes/api/ApiFormatYaml.php',
        'ApiHelp' => __DIR__ . '/includes/api/ApiHelp.php',
        'ApiHelpParamValueMessage' => __DIR__ . '/includes/api/ApiHelpParamValueMessage.php',
        'ApiImageRotate' => __DIR__ . '/includes/api/ApiImageRotate.php',
        'FindMissingFiles' => __DIR__ . '/maintenance/findMissingFiles.php',
        'FindOrphanedFiles' => __DIR__ . '/maintenance/findOrphanedFiles.php',
        'FixBug20757' => __DIR__ . '/maintenance/storage/fixBug20757.php',
 +      'FixDefaultJsonContentPages' => __DIR__ . '/maintenance/fixDefaultJsonContentPages.php',
        'FixDoubleRedirects' => __DIR__ . '/maintenance/fixDoubleRedirects.php',
        'FixExtLinksProtocolRelative' => __DIR__ . '/maintenance/fixExtLinksProtocolRelative.php',
        'FixTimestamps' => __DIR__ . '/maintenance/fixTimestamps.php',
        'HTMLCacheUpdateJob' => __DIR__ . '/includes/jobqueue/jobs/HTMLCacheUpdateJob.php',
        'HTMLCheckField' => __DIR__ . '/includes/htmlform/HTMLCheckField.php',
        'HTMLCheckMatrix' => __DIR__ . '/includes/htmlform/HTMLCheckMatrix.php',
+       'HTMLComboboxField' => __DIR__ . '/includes/htmlform/HTMLComboboxField.php',
        'HTMLEditTools' => __DIR__ . '/includes/htmlform/HTMLEditTools.php',
        'HTMLFileCache' => __DIR__ . '/includes/cache/HTMLFileCache.php',
        'HTMLFloatField' => __DIR__ . '/includes/htmlform/HTMLFloatField.php',
        'ImageListPager' => __DIR__ . '/includes/specials/SpecialListfiles.php',
        'ImagePage' => __DIR__ . '/includes/page/ImagePage.php',
        'ImageQueryPage' => __DIR__ . '/includes/specialpage/ImageQueryPage.php',
 +      'ImportLogFormatter' => __DIR__ . '/includes/logging/ImportLogFormatter.php',
        'ImportReporter' => __DIR__ . '/includes/specials/SpecialImport.php',
        'ImportSiteScripts' => __DIR__ . '/maintenance/importSiteScripts.php',
        'ImportSites' => __DIR__ . '/maintenance/importSites.php',
@@@ -128,6 -128,7 +128,7 @@@ class HTMLForm extends ContextSource 
                'textwithbutton' => 'HTMLTextFieldWithButton',
                'textarea' => 'HTMLTextAreaField',
                'select' => 'HTMLSelectField',
+               'combobox' => 'HTMLComboboxField',
                'radio' => 'HTMLRadioField',
                'multiselect' => 'HTMLMultiSelectField',
                'limitselect' => 'HTMLSelectLimitField',
                                $v = empty( $value->mParams['nodata'] )
                                        ? $this->mFieldData[$key]
                                        : $value->getDefault();
 -                              $html[] = $value->$getFieldHtmlMethod( $v );
  
 -                              $labelValue = trim( $value->getLabel() );
 -                              if ( $labelValue != '&#160;' && $labelValue !== '' ) {
 -                                      $hasLabel = true;
 -                              }
 +                              $retval = $value->$getFieldHtmlMethod( $v );
 +
 +                              // check, if the form field should be added to
 +                              // the output.
 +                              if ( $value->hasVisibleOutput() ) {
 +                                      $html[] = $retval;
 +
 +                                      $labelValue = trim( $value->getLabel() );
 +                                      if ( $labelValue != '&#160;' && $labelValue !== '' ) {
 +                                              $hasLabel = true;
 +                                      }
  
 -                              if ( get_class( $value ) !== 'HTMLHiddenField' &&
 -                                      get_class( $value ) !== 'HTMLApiField'
 -                              ) {
                                        $hasUserVisibleFields = true;
                                }
                        } elseif ( is_array( $value ) ) {