You are here

function theme_photoswipe_imagefield in PhotoSwipe 7

Same name and namespace in other branches
  1. 7.2 photoswipe.theme.inc \theme_photoswipe_imagefield()

Returns HTML for an image using a specific Photoswipe image style.

Parameters

$variables: An associative array containing:

  • image: image item as array.
  • path: The path of the image that should be displayed in the Photoswipe.
1 theme call to theme_photoswipe_imagefield()
theme_photoswipe_image_formatter in ./photoswipe.theme.inc
Returns HTML for an Photoswipe image field formatter.

File

./photoswipe.theme.inc, line 66
Photoswipe theme functions.

Code

function theme_photoswipe_imagefield($variables) {
  $class = array(
    'photoswipe',
  );
  if (!empty($variables['image']['style_name'])) {
    $image = theme('image_style', $variables['image']);
  }
  else {
    $image = theme('image', $variables['image']);
  }
  $options = array(
    'html' => TRUE,
    'attributes' => array(
      'class' => implode(' ', $class),
    ),
  );
  return l($image, $variables['path'], $options);
}