You are here

function shadowbox_theme in Shadowbox 6.2

Same name and namespace in other branches
  1. 8 shadowbox.module \shadowbox_theme()
  2. 6.4 shadowbox.module \shadowbox_theme()
  3. 6.3 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 598
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(
        'view_preset' => NULL,
        'field' => NULL,
        'item' => NULL,
        'attributes' => array(),
        'gallery' => NULL,
      ),
    ),
    'shadowbox_image' => array(
      'arguments' => array(
        'path' => NULL,
        'alt' => '',
        'title' => '',
        'attributes' => array(),
      ),
    ),
  );

  // TODO: Add filefield support
  // TODO: Add emfield support
  // TODO: Which other CCK modules should we support?
  if (module_exists('imagecache') && module_exists('imagefield')) {
    $presets = shadowbox_get_imagecache_presets();
    foreach ($presets as $preset) {
      $source = $preset['presetname'];
      $theme['shadowbox_formatter_shadowbox___original___' . $source] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox___' . $source . '___original'] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery___original___' . $source] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery___' . $source . '___original'] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery_field___original___' . $source] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery_field___' . $source . '___original'] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery_nid___original___' . $source] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      $theme['shadowbox_formatter_shadowbox_gallery_nid___' . $source . '___original'] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_shadowbox_formatter_imagefield',
      );
      foreach ($presets as $preset) {
        $destination = $preset['presetname'];
        if ($source != $destination) {
          $theme['shadowbox_formatter_shadowbox___' . $source . '___' . $destination] = array(
            'arguments' => array(
              'element' => NULL,
            ),
            'function' => 'theme_shadowbox_formatter_imagefield',
          );
          $theme['shadowbox_formatter_shadowbox_gallery___' . $source . '___' . $destination] = array(
            'arguments' => array(
              'element' => NULL,
            ),
            'function' => 'theme_shadowbox_formatter_imagefield',
          );
          $theme['shadowbox_formatter_shadowbox_gallery_field___' . $source . '___' . $destination] = array(
            'arguments' => array(
              'element' => NULL,
            ),
            'function' => 'theme_shadowbox_formatter_imagefield',
          );
          $theme['shadowbox_formatter_shadowbox_gallery_nid___' . $source . '___' . $destination] = array(
            'arguments' => array(
              'element' => NULL,
            ),
            'function' => 'theme_shadowbox_formatter_imagefield',
          );
        }
      }
    }
  }
  return $theme;
}