function theme_upload_element_image_preview in Upload element 6
This creates the thumbnail preview HTML.
Parameters
array $element:
Return value
string HTML for image thumbnail.
File
- ./
upload_element.module, line 417 - A module that provides two new elements to the FAPI for file handling.
Code
function theme_upload_element_image_preview($element = NULL) {
$fid = 'no_image';
if ($file = _upload_element_parse_value($element)) {
$fid = $file->fid;
}
$src = url('upload_element/' . $element['#build_id'] . '/' . $element['#name'] . '/' . $fid);
return '<div class="upload-element-preview"><img src="' . $src . '" alt="' . t('Image preview') . '" /></div>';
}