You are here

function theme_lightbox2_formatter_imagefield in Lightbox2 6

Handler for Lightbox2 display of imagecache + imagefield CCK fields.

The compact view shows only the first image in a multiple imagefield but shows all images in the lightbox.

Parameters

$element: The CCK field element.

Return value

HTML output for displaying the image and link.

1 string reference to 'theme_lightbox2_formatter_imagefield'
lightbox2_theme in ./lightbox2.module
Implementation of hook_theme().

File

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

Code

function theme_lightbox2_formatter_imagefield($element) {
  if (!module_exists("imagecache") || !module_exists("imagefield")) {
    return;
  }
  $field_name = $element['#field_name'];
  $item = $element['#item'];
  $formatter = $element['#formatter'];
  $node = node_load($element['#item']['nid']);
  if (strpos($formatter, '__lightbox2__') !== FALSE || strpos($formatter, '__lightshow2__') !== FALSE || strpos($formatter, '__lightframe2__') !== FALSE || strpos($formatter, '__lightbox2_compact__') !== FALSE || strpos($formatter, '__lightshow2_compact__') !== FALSE || strpos($formatter, '__lightframe2_compact__') !== FALSE) {
    list($tmp, $lightbox_type, $view_preset, $lightbox_preset) = explode('__', $formatter, 4);
    return lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $node, $view_preset, $lightbox_preset);
  }
}