You are here

function lightbox2_theme in Lightbox2 7

Same name and namespace in other branches
  1. 8 lightbox2.module \lightbox2_theme()
  2. 6 lightbox2.module \lightbox2_theme()
  3. 7.2 lightbox2.module \lightbox2_theme()

Implementation of hook_theme().

File

./lightbox2.module, line 1118
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function lightbox2_theme($existing, $type, $theme, $path) {
  $theme = array();
  $theme['lightbox2_image'] = array(
    'variables' => array(
      'item' => NULL,
      'path' => NULL,
      'lightbox_type' => NULL,
      'image_style' => NULL,
      'lightbox_style' => NULL,
      'node_id' => NULL,
      'field_name' => NULL,
      'caption' => NULL,
    ),
  );

  //return($theme);

  /*
    $theme = array(
      'lightbox2_image' => array(
      'variables' => array(
       'item' => NULL,
       'path' => NULL,
       'image_style' => NULL
       ),
      ),
      // Emfield theme functions.
      'lightbox2_emimage' => array(
        'variables' => array(
          'field' => NULL,
          'item' => NULL,
          'formatter' => NULL,
          'node' => NULL,
          'args' => array()
        ),
      ),
      'lightbox2_formatter_emimage' => array(
        'render element' => 'element',
      ),
      'lightbox2_formatter_emimage_lightbox2' => array(
        'render element' => 'element',
        'function' => 'theme_lightbox2_formatter_emimage',
      ),
      'lightbox2_formatter_emimage_lightshow2' => array(
        'render element' => 'element',
        'function' => 'theme_lightbox2_formatter_emimage',
      ),
      'lightbox2_formatter_emimage_lightframe2' => array(
        'render element' => 'element',
        'function' => 'theme_lightbox2_formatter_emimage',
      ),
      'lightbox2_formatter_emvideo_lightvideo' => array(
        'render element' => 'element',
      ),
      'lightbox2_emvideo' => array(
        'variables' => array(
          'field' => NULL,
          'item' => NULL,
          'formatter' => NULL,
          'node' => NULL
        ),
      ),
      // Filefield theme functions.
      'lightbox2_formatter_filefield_lightframe' => array(
        'render element' => 'element',
      ),
      'lightbox2_file_formatter_lightbox2_iframe' => array(
        'variables' => array(
          'file' => NULL,
          'field' => NULL,
          'file_formatter_settings' => NULL
  	  ),
      ),
      // Global imagecache + imagefield theme functions.
      'lightbox2_formatter_imagefield' => array(
         'render element' => 'element',
      ),
      'imagefield_image_imagecache_lightbox2' => array(
        'variables' => array(
          'view_preset' => NULL,
          'field_name' => NULL,
          'item' => NULL,
          'node' => NULL,
          'rel' => 'lightbox',
          'args' => array()
        ),
      ),
    );

     // Additional imagecache + imagefield theme functions, by preset.
    if (module_exists("image")) {

      $theme['lightbox2_formatter_imagefield__lightframe2__original__node'] = array(
        'render element' => 'element',
        'function' => 'theme_lightbox2_formatter_imagefield',
      );
      $theme['lightbox2_formatter_imagefield__lightframe2__link__node'] = array(
        'arguments' => array('element' => NULL),
        'function' => 'theme_lightbox2_formatter_imagefield',
        'file' => 'lightbox2.formatter.inc',
      );

      foreach (image_styles() as $src) {
        $theme['lightbox2_formatter_imagefield__lightbox2__'. $src['name'] .'__original'] = array(
          'render element' => 'element',
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
        $theme['lightbox2_formatter_imagefield__lightbox2_compact__'. $src['name'] .'__original'] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
        $theme['lightbox2_formatter_imagefield__lightshow2__'. $src['name'] .'__original'] = array(
          'render element' => 'element',
          'function' => 'theme_lightbox2_formatter_imagefield',
        );
        $theme['lightbox2_formatter_imagefield__lightshow2_compact__'. $src['name'] .'__original'] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
        $theme['lightbox2_formatter_imagefield__lightbox2__original__'. $src['name']] = array(
          'render element' => 'element',
          'function' => 'theme_lightbox2_formatter_imagefield',
        );
        $theme['lightbox2_formatter_imagefield__lightbox2_compact__original__'. $src['name']] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
      	$theme['lightbox2_formatter_imagefield__lightshow2__original__'. $src['name']] = array(
          'render element' => 'element',
          'function' => 'theme_lightbox2_formatter_imagefield',

        );
        $theme['lightbox2_formatter_imagefield__lightshow2_compact__original__'. $src['name']] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
        $theme['lightbox2_formatter_imagefield__lightframe2__'. $src['name'] .'__node'] = array(
          'render element' => 'element',
          'function' => 'theme_lightbox2_formatter_imagefield',
        );
        $theme['lightbox2_formatter_imagefield__lightbox2__link__'. $src['name']] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );
        $theme['lightbox2_formatter_imagefield__lightshow2__link__'. $src['name']] = array(
          'arguments' => array('element' => NULL),
          'function' => 'theme_lightbox2_formatter_imagefield',
          'file' => 'lightbox2.formatter.inc',
        );

        foreach (image_styles() as $dest) {
          $theme['lightbox2_formatter_imagefield__lightbox2__'. $src['name'] .'__'. $dest['name']] = array(
            'render element' => 'element',
            'function' => 'theme_lightbox2_formatter_imagefield',
          );
          $theme['lightbox2_formatter_imagefield__lightbox2_compact__'. $src['name'] .'__'. $dest['name']] = array(
            'arguments' => array('element' => NULL),
            'function' => 'theme_lightbox2_formatter_imagefield',
            'file' => 'lightbox2.formatter.inc',
          );
          $theme['lightbox2_formatter_imagefield__lightshow2__'. $src['name'] .'__'. $dest['name']] = array(
            'render element' => 'element',
            'function' => 'theme_lightbox2_formatter_imagefield',
          );
          $theme['lightbox2_formatter_imagefield__lightshow2_compact__'. $src['name'] .'__'. $dest['name']] = array(
            'arguments' => array('element' => NULL),
            'function' => 'theme_lightbox2_formatter_imagefield',
            'file' => 'lightbox2.formatter.inc',
          );
        }
      }
    }

    // Additional Insert theme functions.
    if (module_exists('insert')) {
      // Theme functions in lightbox2.insert.inc.
      $theme['lightbox2_insert_image'] = array(
        'arguments' => array('item' => NULL, 'widget' => NULL, 'type' => NULL, 'image_preset_name' => NULL, 'link_preset_name' => NULL),
        'template' => 'lightbox2-insert-image',
      );
    }*/
  foreach ($theme as &$array) {
    $array['file'] = 'lightbox2.formatter.inc';
  }
  return $theme;
}