You are here

function theme_photobox_imagefield in PhotoboxPhotobox 7

Returns HTML for an image using a specific Photobox 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 Photobox.
  • gid: Gallery id for Photobox image grouping.
1 theme call to theme_photobox_imagefield()
theme_photobox_image_formatter in ./photobox.theme.inc
Returns HTML for a Photobox image field formatter.

File

./photobox.theme.inc, line 120
Photobox theme functions.

Code

function theme_photobox_imagefield($variables) {
  $class = array(
    'photobox',
  );
  if ($variables['image']['style_name'] == 'hide') {
    $image = '';
    $class[] = 'js-hide';
  }
  elseif (!empty($variables['image']['style_name'])) {
    $image = theme('image_style', $variables['image']);
  }
  else {
    $image = theme('image', $variables['image']);
  }
  $options = array(
    'html' => TRUE,
    'attributes' => array(
      'title' => $variables['title'],
      'class' => $class,
      'data-photobox-gallery' => $variables['gid'],
    ),
  );
  return l($image, $variables['path'], $options);
}