You are here

function theme_imagefield_formatter_image_imagelink in ImageField 6.3

File

./imagefield_formatter.inc, line 36
ImageField formatter hooks and callbacks.

Code

function theme_imagefield_formatter_image_imagelink($element) {

  // Inside a view $element may contain null data. In that case, just return.
  if (empty($element['#item']['fid'])) {
    return '';
  }
  $item = $element['#item'];
  $imagetag = theme('imagefield_formatter_image_plain', $element);
  $original_image_url = file_create_url($item['filepath']);
  $class = 'imagefield imagefield-imagelink imagefield-' . $element['#field_name'];
  return l($imagetag, $original_image_url, array(
    'attributes' => array(
      'class' => $class,
    ),
    'html' => TRUE,
  ));
}