function theme_image_ncck_image_preview in Embedded Media Field 5
File
- contrib/
image_ncck/ image_ncck.module, line 376
Code
function theme_image_ncck_image_preview($field, $item, $formatter, $node) {
if ($item['value'] && $item['provider']) {
$code = $item['value'];
$width = $field['widget']['preview_width'] === '' ? IMAGE_NCCK_DEFAULT_PREVIEW_WIDTH : $field['widget']['preview_width'];
$height = $field['widget']['preview_height'] === '' ? IMAGE_NCCK_DEFAULT_PREVIEW_HEIGHT : $field['widget']['preview_height'];
$link = $field['widget']['preview_link'] === '' ? IMAGE_NCCK_DEFAULT_PREVIEW_LINK : $field['widget']['preview_link'];
if ($link == IMAGE_NCCK_LINK_CONTENT) {
$link = 'node/' . $node->nid;
}
else {
if ($link == IMAGE_NCCK_LINK_PROVIDER) {
$link = module_invoke('emfield', 'include_invoke', 'image_ncck', $item['provider'], 'embedded_link', $code, $item['data']);
}
else {
$link = NULL;
}
}
$title = module_invoke('emfield', 'include_invoke', 'image_ncck', $item['provider'], 'image_title', $code, $item['data']);
$output = theme('image_ncck_image', $field, $item, $formatter, $node, $code, $width, $height, $title, $link);
}
return $output;
}