function theme_brightcove_cck_lightbox2_imagecache in Brightcove Video Connect 6
Same name and namespace in other branches
- 6.2 brightcove_cck/brightcove_cck.formatters.inc \theme_brightcove_cck_lightbox2_imagecache()
Theme callback for Lightbox2 with imagecache player.
Parameters
$element: Element with the Video ID.
Return value
Player HTML code.
1 string reference to 'theme_brightcove_cck_lightbox2_imagecache'
- brightcove_cck_theme in brightcove_cck/
brightcove_cck.module - Implementation of hook_theme().
File
- brightcove_cck/
brightcove_cck.formatters.inc, line 15 - Formatters for video CCK field.
Code
function theme_brightcove_cck_lightbox2_imagecache($element) {
$preset_data = str_replace('lightbox2_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->thumbnailURL)) {
$image = theme('imagecache', $preset, brightcove_remote_image($video->{$field}));
}
else {
$image = theme('imagecache', $preset, brightcove_get_default_image());
}
return theme('brightcove_cck_formatter_lightbox2_player_' . $field, $element, $image, $preset);
}
}