You are here

function theme_imceimage_formatter_with_caption in Imce CCK Image 6

Same name and namespace in other branches
  1. 6.2 imceimage.module \theme_imceimage_formatter_with_caption()

displays the image as an img with caption

File

./imceimage.module, line 401

Code

function theme_imceimage_formatter_with_caption($element) {
  $item = $element['#item'];
  $field = $element['#field_name'];
  $delta = $element['#delta'];
  $id = "imceimage-" . $field;
  if ($item['imceimage_path']) {
    $image = theme_imceimage_image($item['imceimage_path'], $item['imceimage_width'], $item['imceimage_height'], $item['imceimage_alt'], $item['imceimage_title'], $id);
    $caption = $item['imceimage_alt'];
    return "<div class='image-with-caption'><div class='image'>" . $image . "</div><div class='caption'>" . $caption . "</div></div>";
  }
  else {
    return '';
  }
}