You are here

function template_preprocess_fancybox_insert_image in fancyBox 7.2

Preprocess function for fancybox-insert-image.tpl.php.

File

./fancybox.theme.inc, line 153
Provides the fancyBox jQuery plugin, a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages, and an extensive settings page for configuring fancyBox settings and how fancyBox…

Code

function template_preprocess_fancybox_insert_image(&$variables) {
  $classes = array();
  $file = file_load($variables['item']['fid']);
  if (!empty($variables['widget']['settings']['insert_class'])) {
    $classes = explode(' ', $variables['widget']['settings']['insert_class']);
  }
  $classes[] = 'image-' . $variables['item']['style_name'];
  foreach ($classes as $i => $value) {
    $classes[$i] = drupal_html_class($value);
  }
  $variables['image_path'] = image_style_url($variables['item']['style_name'], $file->uri);
  $variables['link_path'] = file_create_url($file->uri);
  $variables['class'] = implode(' ', $classes);
  $variables['gid'] = 'gallery-all';
}