function theme_brightcove_cck_node_image_imagecache in Brightcove Video Connect 6
Same name and namespace in other branches
- 6.2 brightcove_cck/brightcove_cck.formatters.inc \theme_brightcove_cck_node_image_imagecache()
Theme callback for imagecache image
Parameters
$element: Element with the Video ID.
Return value
Link HTML code.
1 string reference to 'theme_brightcove_cck_node_image_imagecache'
- brightcove_cck_theme in brightcove_cck/
brightcove_cck.module - Implementation of hook_theme().
File
- brightcove_cck/
brightcove_cck.formatters.inc, line 287 - Formatters for video CCK field.
Code
function theme_brightcove_cck_node_image_imagecache($element) {
$preset_data = str_replace('node_image_imagecache_', '', $element['#formatter']);
list($preset, $field) = split('__', $preset_data);
if (isset($element['#item']['video_id'])) {
$video = brightcove_video_load($element['#item']['video_id']);
/* Temporary turned off, because getting of status in BC API throws error for users without write api key
$status = brightcove_status($element['#item']['video_id']);
if ($status != BRIGHTCOVE_STATUS_COMPLETE && ($message = brightcove_expose_unavailable($status))) {
return $message;
} else if ($status != BRIGHTCOVE_STATUS_COMPLETE) {
return FALSE;
}*/
if (!empty($video->{$field})) {
$image = theme('imagecache', $preset, brightcove_remote_image($video->{$field}));
}
else {
$image = theme('imagecache', $preset, brightcove_get_default_image());
}
return theme('brightcove_cck_formatter_node_image_' . $field, $element, $image);
}
}