function theme_lightbox2_video_cck in Lightbox2 5.2
Generate the HTML output to open embedded cck videos in a lightbox.
Parameters
$field: The field the action is being performed on.
$item: An array, keyed by column, of the data stored for this item in this field.
$formatter: The formatter to use for the field.
$node: The node object.
$options: Array of options available, including the width and height of the video thumbnail.
File
- ./
lightbox2.module, line 1969 - Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.
Code
function theme_lightbox2_video_cck($field, $item, $formatter, $node, $options = array()) {
$thumbnail = theme('video_cck_video_thumbnail', $field, $item, 'video_thumbnail', $node, TRUE, $options);
$destination = 'video-cck/lightbox2/' . $node->nid . '/' . $field['widget']['video_width'] . '/' . $field['widget']['video_height'] . '/' . $field['field_name'] . '/' . $item['provider'] . '/' . $item['value'];
$width = $field['widget']['video_width'] + 20;
$height = $field['widget']['video_height'] + 20;
if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
$width = $field['widget']['video_width'] + 40;
$height = $field['widget']['video_height'] + 40;
}
$rel = 'lightframe[|width:' . $width . 'px; height:' . $height . 'px; overflow:visible;]';
$output = l($thumbnail, $destination, array(
'rel' => $rel,
'class' => $field['type_name'],
), NULL, NULL, FALSE, TRUE);
return $output;
}