You are here

function theme_imagefield_image_imagecache_fancybox in fancyBox 6

Theme ImageCache + Imagefield CCK field.

1 theme call to theme_imagefield_image_imagecache_fancybox()
fancybox_imagefield_image_imagecache in ./fancybox.module
Implementation of hook_field_formatter().

File

./fancybox.theme.inc, line 22
Theme functions for Fancybox module.

Code

function theme_imagefield_image_imagecache_fancybox($namespace, $field, $path, $title = '', $loop = '', $attributes = NULL) {
  if (!empty($path)) {
    $image = theme('imagecache', $namespace, $path, $title, $title, $attributes);
    $settings = variable_get('fancybox_settings', array());
    if ($presetname = $settings['imagefield']['imagecache_preset']) {
      $link_path = imagecache_create_url($presetname, $path);
    }
    else {
      $link_path = file_create_url($path);
    }
    $options = array(
      'html' => TRUE,
      'attributes' => array(
        'title' => $title,
        'class' => "imagefield-fancybox",
      ),
    );
    if ($loop) {
      $options['attributes']['rel'] = 'imagefield-fancybox-' . $loop;
    }
    return l($image, $link_path, $options);
  }
}