You are here

function theme_video_formatter_video_nodelink in Video 6.5

Same name and namespace in other branches
  1. 6.4 video_formatter.inc \theme_video_formatter_video_nodelink()

Renders the video thumbnail as a link to the node page.

1 theme call to theme_video_formatter_video_nodelink()
theme_video_formatter_video_colorbox in ./video_formatter.inc
Renders the video thumbnail linked to the absolute filepath of the video.

File

./video_formatter.inc, line 42
Video formatter hooks and callbacks.

Code

function theme_video_formatter_video_nodelink($element, $imagecache = FALSE) {

  // Inside a view $element may contain null data. In that case, just return.
  if (empty($element['#item']['fid'])) {
    return '';
  }

  // Setup our thumbnail object
  module_load_include('inc', 'video', '/includes/video_helper');
  $video_helper = new video_helper();
  $thumbnail = $video_helper
    ->thumbnail_object($element);

  // Get our themed image
  $image = theme('video_image', $thumbnail, $thumbnail->alt, $thumbnail->title, '', TRUE, $imagecache);
  $class = 'popups video video-nodelink video-' . $element['#field_name'];
  return l($image, 'node/' . $element['#node']->nid, array(
    'attributes' => array(
      'class' => $class,
    ),
    'html' => TRUE,
  ));
}