function theme_media_element in D7 Media 7.2
Same name and namespace in other branches
- 7.4 media.module \theme_media_element()
- 7.3 media.module \theme_media_element()
Returns HTML for a managed file element.
Parameters
$variables: An associative array containing:
- element: A render element representing the file.
File
- ./
media.module, line 1053 - Media API
Code
function theme_media_element($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-media';
// 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;
}