You are here

function theme_imagefield_image_imagecache_thickbox in Thickbox 6

Same name and namespace in other branches
  1. 5 thickbox.module \theme_imagefield_image_imagecache_thickbox()

Implementation of theme_imagefield_image_imagecache_thickbox().

Parameters

$namespace: presetname of the derivative you wish to generate a tag for.

$path: path to the original image you wish to create a derivative image tag for.

$alt: img tag alternate text

$title: img tag title text

$gid: gallery id

attributes: optional drupal attributes array. If attributes is set, the default imagecache classes will not be set automatically, you must do this manually.

1 theme call to theme_imagefield_image_imagecache_thickbox()
thickbox_field_formatter in ./thickbox.module
Implementation of hook_field_formatter().

File

./thickbox.module, line 237
Author: Fredrik Jonsson fredrik at combonet dot se The thickbox module is a simple wrapper for the jquery plugin ThickBox http://jquery.com/demo/thickbox/.

Code

function theme_imagefield_image_imagecache_thickbox($namespace, $path, $alt = '', $title = '', $gid = '', $attributes = NULL) {
  if (!empty($path)) {
    $image = theme('imagecache', $namespace, $path, $alt, $title, $attributes);
    if ($presetname = variable_get('thickbox_imagecache_preset', 0)) {
      $link_path = imagecache_create_url($presetname, $path);
    }
    else {
      $link_path = file_create_url($path);
    }
    return l($image, $link_path, array(
      'html' => TRUE,
      'attributes' => array(
        'title' => $title,
        'class' => 'thickbox',
        'rel' => 'gallery-' . $gid,
      ),
    ));
  }
}