You are here

function theme_brightcove_cck_node_link_imagecache in Brightcove Video Connect 6

Same name and namespace in other branches
  1. 6.2 brightcove_cck/brightcove_cck.formatters.inc \theme_brightcove_cck_node_link_imagecache()

Theme callback for imagecache image linking to node

Parameters

$element: Element with the Video ID.

Return value

Link HTML code.

1 string reference to 'theme_brightcove_cck_node_link_imagecache'
brightcove_cck_theme in brightcove_cck/brightcove_cck.module
Implementation of hook_theme().

File

brightcove_cck/brightcove_cck.formatters.inc, line 201
Formatters for video CCK field.

Code

function theme_brightcove_cck_node_link_imagecache($element) {
  $preset_data = str_replace('node_link_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_link_' . $field, $element, $image, $preset);
  }
}