You are here

function pdfpreview_theme in PDFPreview 6

Same name and namespace in other branches
  1. 8 pdfpreview.module \pdfpreview_theme()
  2. 7.2 pdfpreview.module \pdfpreview_theme()
  3. 7 pdfpreview.module \pdfpreview_theme()
  4. 2.0.x pdfpreview.module \pdfpreview_theme()

Implements hook_theme().

We declare our theme functions according to the array keys in hook_field_formatter_info

File

./pdfpreview.module, line 51
This module creates a formatter for CCK filefields that shows a snapshot of the first page of pdf files as link to the file.

Code

function pdfpreview_theme() {
  $theme = array(
    'pdfpreview_formatter_default' => array(
      'function' => 'theme_pdfpreview_formatter',
      'arguments' => array(
        'element' => NULL,
      ),
    ),
  );
  if (module_exists('imagecache')) {
    foreach (imagecache_presets() as $preset) {
      $theme['pdfpreview_formatter_' . $preset['presetname'] . '][pdfpreview'] = array(
        'function' => 'theme_pdfpreview_formatter',
        'arguments' => array(
          'element' => NULL,
        ),
      );
    }
  }
  return $theme;
}