You are here

function theme_brightcove_cck_node_image 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_image()

Theme callback for Default thumbnail.

Parameters

$element: Element with the Video ID.

Return value

Link HTML code.

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

File

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

Code

function theme_brightcove_cck_node_image($element, $image = NULL) {
  if (!empty($element['#item']['video_id'])) {
    $field = str_replace('node_image_', '', $element['#formatter']);
    $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 (!$image) {
      if (!empty($video->{$field})) {
        $image = theme('image', $video->{$field}, '', '', NULL, FALSE);
      }
      else {
        $image = theme('image', brightcove_get_default_image(), $video_name, $video_name, array(
          'width' => 120,
          'height' => 120,
        ), FALSE);
      }
    }
    $output = $image;
    $video_id = $element['#item']['video_id'];
    $nid = $element['#node']->nid;
  }
  if ($output) {
    return theme('brightcove_cck_node_image', $output, $video_id, $nid, $field, $element['#field_name'], $element['#type_name']);
  }
}