1 image.theme.inc | theme_image_widget($variables) |
Returns HTML for an image field widget.
Parameters
$variables: An associative array containing:
- element: A render element representing the image field widget.
Related topics
File
- core/
modules/ image/ image.theme.inc, line 345 - Theme functions for the Image module.
Code
function theme_image_widget($variables) {
$element = $variables['element'];
$output = '';
$output .= '<div class="image-widget form-managed-file clearfix">';
if (isset($element['preview'])) {
$output .= '<div class="image-preview">';
$output .= backdrop_render($element['preview']);
$output .= '</div>';
}
$output .= '<div class="image-widget-data">';
if ($element['fid']['#value'] != 0) {
$element['filename']['#markup'] .= ' <span class="file-size">(' . format_size($element['#file']->filesize) . ')</span> ';
}
$output .= backdrop_render_children($element);
$output .= '</div>';
$output .= '</div>';
return $output;
}