Merge "Implement HTMLComboboxField"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index ac81ef2..b0d90af 100644 (file)
@@ -1403,16 +1403,19 @@ class HTMLForm extends ContextSource {
                                $v = empty( $value->mParams['nodata'] )
                                        ? $this->mFieldData[$key]
                                        : $value->getDefault();
-                               $html[] = $value->$getFieldHtmlMethod( $v );
 
-                               $labelValue = trim( $value->getLabel() );
-                               if ( $labelValue != ' ' && $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 != ' ' && $labelValue !== '' ) {
+                                               $hasLabel = true;
+                                       }
 
-                               if ( get_class( $value ) !== 'HTMLHiddenField' &&
-                                       get_class( $value ) !== 'HTMLApiField'
-                               ) {
                                        $hasUserVisibleFields = true;
                                }
                        } elseif ( is_array( $value ) ) {