You are here

function shadowbox_theme in Shadowbox 6.3

Same name and namespace in other branches
  1. 8 shadowbox.module \shadowbox_theme()
  2. 6.4 shadowbox.module \shadowbox_theme()
  3. 6.2 shadowbox.module \shadowbox_theme()
  4. 7.4 shadowbox.module \shadowbox_theme()
  5. 7.3 shadowbox.module \shadowbox_theme()

Implementation of hook_theme().

File

./shadowbox.module, line 168
Shadowbox, a JavaScript media viewer application for displaying content in a modal dialogue.

Code

function shadowbox_theme() {
  $theme = array(
    'imagefield_image_imagecache_shadowbox' => array(
      'arguments' => array(
        'source' => NULL,
        'destination' => NULL,
        'item' => NULL,
        'gallery_id' => array(),
        'field_type_names' => NULL,
      ),
    ),
    'shadowbox_image' => array(
      'arguments' => array(
        'path' => NULL,
        'alt' => '',
        'title' => '',
        'attributes' => array(),
      ),
    ),
  );
  if (module_exists('imagecache') && module_exists('imagefield')) {
    $presets = shadowbox_get_imagecache_presets();
    $formatter = array(
      'arguments' => array(
        'element' => NULL,
      ),
      'function' => 'theme_shadowbox_formatter_imagefield',
    );
    foreach ($presets as $preset) {
      $source = $preset['presetname'];
      $theme["shadowbox_formatter_shadowbox___original___{$source}"] = $formatter;
      $theme["shadowbox_formatter_shadowbox___{$source}___original"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery___original___{$source}"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery___{$source}___original"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery_field___original___{$source}"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery_field___{$source}___original"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery_nid___original___{$source}"] = $formatter;
      $theme["shadowbox_formatter_shadowbox_gallery_nid___{$source}___original"] = $formatter;
      foreach ($presets as $preset) {
        $destination = $preset['presetname'];
        if ($source != $destination) {
          $theme["shadowbox_formatter_shadowbox___{$source}___{$destination}"] = $formatter;
          $theme["shadowbox_formatter_shadowbox_gallery___{$source}___{$destination}"] = $formatter;
          $theme["shadowbox_formatter_shadowbox_gallery_field___{$source}___{$destination}"] = $formatter;
          $theme["shadowbox_formatter_shadowbox_gallery_nid___{$source}___{$destination}"] = $formatter;
        }
      }
    }
  }
  return $theme;
}