diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-05 12:08:16 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-09-05 12:08:16 -0700 |
commit | cb8c655a183f1777b9b9b8a0d063b339c0f106ff (patch) | |
tree | 80c5881f4ae7c96b2a8fba3d99de5facc94b5b03 /modules/file | |
parent | 9d35f2586c50094f8caa2ad0f1c43facbbabe027 (diff) | |
download | brdo-cb8c655a183f1777b9b9b8a0d063b339c0f106ff.tar.gz brdo-cb8c655a183f1777b9b9b8a0d063b339c0f106ff.tar.bz2 |
Issue #1118016 by dereine, pwolanin: Fixed conditional visibility of a managed_file() using #states attribute does not work.
Diffstat (limited to 'modules/file')
-rw-r--r-- | modules/file/file.module | 11 |
1 files changed, 10 insertions, 1 deletions
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 .= '<div class="form-managed-file">'; + $output .= '<div' . drupal_attributes($attributes) . '>'; $output .= drupal_render_children($element); $output .= '</div>'; return $output; |