You are here

function theme_lightbox2_formatter_filefield_lightframe in Lightbox2 6

Theme function for the lightbox iframe filefield formatter.

Parameters

$element: The CCK field element.

Return value

The themed link to the file, with lightframe support.

File

./lightbox2.formatter.inc, line 286
Lightbox2 formatter hooks and callbacks.

Code

function theme_lightbox2_formatter_filefield_lightframe($element) {
  $file = $element['#item'];
  $field = content_fields($element['#field_name']);
  if (!filefield_view_access($field['field_name']) || empty($file['list'])) {
    return '';
  }
  if (empty($file['fid']) || !is_file($file['filepath'])) {
    return '';
  }
  $file = (object) $file;
  if (!lightbox2_check_filefield_extension($file, $field)) {
    return '';
  }
  drupal_add_css(drupal_get_path('module', 'filefield') . '/filefield.css');
  return '<div class="filefield-item">' . theme('lightbox2_file_formatter_lightbox2_iframe', $file, $field, NULL) . '</div>';
}