function theme_file_managed_file

Returns HTML for a managed file element.

Parameters

$variables: An associative array containing:

  • element: A render element representing the file.

Related topics

1 theme call to theme_file_managed_file()
file_element_info in modules/file/file.module
Implements hook_element_info().

File

modules/file/file.module, line 734

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.