function theme_file_managed_file

7.x file.module theme_file_managed_file($variables)

Returns HTML for a managed file element.

Parameters

$variables: An associative array containing:

  • element: A render element representing the file.

Related topics

2 string references to the theme hook from theme_file_managed_file()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

file_element_info in drupal/modules/file/file.module
Implements hook_element_info().
file_theme in drupal/modules/file/file.module
Implements hook_theme().

File

drupal/modules/file/file.module, line 711
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

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' . drupal_attributes($attributes) . '>';
  $output .= drupal_render_children($element);
  $output .= '</div>';
  return $output;
}