function theme_colorbox_imagefield in Colorbox 6
Same name and namespace in other branches
- 7.2 colorbox.theme.inc \theme_colorbox_imagefield()
- 7 colorbox.theme.inc \theme_colorbox_imagefield()
Implementation of theme_colorbox_imagefield().
Parameters
$presetname: 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_colorbox_imagefield()
- theme_colorbox_formatter_imagefield in ./
colorbox.theme.inc - Handler for Colorbox display of imagecache + imagefield CCK fields.
File
- ./
colorbox.theme.inc, line 93 - Colorbox theme functions.
Code
function theme_colorbox_imagefield($presetname, $path, $alt = '', $title = '', $gid = '', $field_name = '', $attributes = NULL) {
if (!empty($path)) {
$image = theme('imagecache', $presetname, $path, $alt, $title, $attributes);
if ($colorbox_presetname = variable_get('colorbox_imagecache_preset', 0)) {
$link_path = imagecache_create_url($colorbox_presetname, $path);
}
else {
$link_path = file_create_url($path);
}
$class = 'colorbox imagefield imagefield-imagelink imagefield-' . $field_name;
return l($image, $link_path, array(
'html' => TRUE,
'attributes' => array(
'title' => $title,
'class' => $class,
'rel' => 'gallery-' . $gid,
),
));
}
}