You are here

function theme_lightbox2_image in Lightbox2 6

Same name and namespace in other branches
  1. 8 lightbox2.formatter.inc \theme_lightbox2_image()
  2. 5.2 lightbox2.module \theme_lightbox2_image()
  3. 7.2 lightbox2.formatter.inc \theme_lightbox2_image()
  4. 7 lightbox2.formatter.inc \theme_lightbox2_image()

Theme function for displaying the lightbox2 trigger image in an imagefield.

Parameters

$path: The path to the image to be displayed.

$alt: The image alternative text.

$title: The image title.

$attributes: An array of image attributes, e.g. class name.

Return value

HTML output for displaying the image.

1 theme call to theme_lightbox2_image()
theme_imagefield_image_imagecache_lightbox2 in ./lightbox2.formatter.inc
Generate the HTML output for imagefield + imagecache images so they can be opened in a lightbox by clicking on the image on the node page or in a view.

File

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

Code

function theme_lightbox2_image($path, $alt = '', $title = '', $attributes = array()) {
  $attributes_html = drupal_attributes($attributes);
  $image = '<img src="' . file_create_url($path) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" ' . $attributes_html . ' />';
  return $image;
}