From cb8c655a183f1777b9b9b8a0d063b339c0f106ff Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 5 Sep 2011 12:08:16 -0700 Subject: Issue #1118016 by dereine, pwolanin: Fixed conditional visibility of a managed_file() using #states attribute does not work. --- modules/file/file.module | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/file/file.module') diff --git a/modules/file/file.module b/modules/file/file.module index 83de0f622..4fc998501 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -643,9 +643,18 @@ function file_managed_file_save_upload($element) { function theme_file_managed_file($variables) { $element = $variables['element']; + $attributes = array(); + if (isset($element['#id'])) { + $attributes['id'] = $element['#id']; + } + if (!empty($element['#attributes']['class'])) { + $attributes['class'] = (array) $element['#attributes']['class']; + } + $attributes['class'][] = 'form-managed-file'; + // This wrapper is required to apply JS behaviors and CSS styling. $output = ''; - $output .= '
'; + $output .= ''; $output .= drupal_render_children($element); $output .= '
'; return $output; -- cgit v1.2.3