You are here

function theme_brightcove_field_entity_link_dialog in Brightcove Video Connect 7.2

Theme callback for image linking to entity.

File

brightcove_field/brightcove_field.formatters.inc, line 223
Formatters for video field.

Code

function theme_brightcove_field_entity_link_dialog($variables) {
  $video_id = isset($variables['element']['video_id']) ? $variables['element']['video_id'] : NULL;
  list($style, $field) = explode('__', str_replace('entity_link_image_', '', $variables['display']['type']));
  if (isset($video_id)) {
    $video = brightcove_video_load($video_id);
    $image = theme('image_style', array(
      'style_name' => $style,
      'path' => empty($video->{$field}) ? brightcove_get_default_image() : brightcove_remote_image($video->{$field}),
    ));
    return theme("brightcove_field_formatter_entity_link_{$field}", array(
      'image' => $image,
      'style' => $style,
    ) + $variables);
  }
  return '';
}