You are here

function photoswipe_theme in PhotoSwipe 6

Same name and namespace in other branches
  1. 8.2 photoswipe.module \photoswipe_theme()
  2. 8 photoswipe.module \photoswipe_theme()
  3. 7.2 photoswipe.module \photoswipe_theme()
  4. 7 photoswipe.module \photoswipe_theme()
  5. 3.x photoswipe.module \photoswipe_theme()

Implementation of hook_theme().

File

./photoswipe.module, line 257

Code

function photoswipe_theme() {
  $theme = array(
    'imagefield_image_imagecache_photoswipe' => array(
      'arguments' => array(
        'source' => NULL,
        'destination' => NULL,
        'item' => NULL,
        'gallery_id' => array(),
        'field_type_names' => NULL,
      ),
    ),
    'photoswipe_image' => array(
      'arguments' => array(
        'path' => NULL,
        'alt' => '',
        'title' => '',
        'attributes' => array(),
      ),
    ),
  );
  if (module_exists('imagecache') && module_exists('imagefield')) {
    $presets = photoswipe_get_imagecache_presets();
    $formatter = array(
      'arguments' => array(
        'element' => NULL,
      ),
      'function' => 'theme_photoswipe_formatter_imagefield',
    );
    foreach ($presets as $preset) {
      $source = $preset['presetname'];
      $theme["photoswipe_formatter_photoswipe___original___{$source}"] = $formatter;
      $theme["photoswipe_formatter_photoswipe___{$source}___original"] = $formatter;
      $theme["photoswipe_formatter_photoswipe_field___original___{$source}"] = $formatter;
      $theme["photoswipe_formatter_photoswipe_field___{$source}___original"] = $formatter;
      $theme["photoswipe_formatter_photoswipe_nid___original___{$source}"] = $formatter;
      $theme["photoswipe_formatter_photoswipe_nid___{$source}___original"] = $formatter;
      foreach ($presets as $preset) {
        $destination = $preset['presetname'];
        if ($source != $destination) {
          $theme["photoswipe_formatter_photoswipe___{$source}___{$destination}"] = $formatter;
          $theme["photoswipe_formatter_photoswipe_field___{$source}___{$destination}"] = $formatter;
          $theme["photoswipe_formatter_photoswipe_nid___{$source}___{$destination}"] = $formatter;
        }
      }
    }
  }
  return $theme;
}