You are here

function theme_prettyphoto_formatters_image in prettyPhoto Formatters 7

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

Parameters

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

Return value

string HTML output for displaying the image.

1 theme call to theme_prettyphoto_formatters_image()
prettyphoto_formatters_image_field_formatter_view in modules/prettyphoto_formatters_image/prettyphoto_formatters_image.module
Implements hook_field_formatter_view().

File

modules/prettyphoto_formatters_image/prettyphoto_formatters_image.formatter.inc, line 17
prettyPhoto formatter hooks and callbacks.

Code

function theme_prettyphoto_formatters_image($variables) {
  $path = $variables['path'];
  $item = $variables['item'];
  $image_style = $variables['image_style'];
  $field_name = $variables['field_name'];
  if (!$variables["pfi_style"]) {
    $path['path'] = file_create_url($item['uri']);
  }
  else {
    $path['path'] = image_style_url($variables["pfi_style"], $item['uri']);
  }
  $path['options']['attributes']['rel'] = 'prettyPhoto[' . $field_name . ']';
  $path['options']['attributes']['title'] = $item['title'];
  $output = theme('image_formatter', array(
    'item' => $item,
    'path' => $path,
    'image_style' => $image_style,
  ));
  return '<div class="prettyphoto-formatter-image">' . $output . '</div>';
}