You are here

function download_file_field_formatter_info in DownloadFile 6

Same name and namespace in other branches
  1. 7.3 download_file.module \download_file_field_formatter_info()
  2. 7 download_file.module \download_file_field_formatter_info()
  3. 7.2 download_file.module \download_file_field_formatter_info()

Implementation of hook_field_formatter_info().

File

./download_file.module, line 239
Module to direct download files or images.

Code

function download_file_field_formatter_info() {
  $formatters = array(
    'direct_download' => array(
      'label' => t('Direct download file'),
      'field types' => array(
        'filefield',
      ),
      'multiple values' => CONTENT_HANDLE_MODULE,
      'description' => t('Displays a link to direct download the file.'),
    ),
    'direct_download_icon' => array(
      'label' => t('Direct download file with the type icon'),
      'field types' => array(
        'filefield',
      ),
      'multiple values' => CONTENT_HANDLE_MODULE,
      'description' => t('Displays a link to direct download the file with the type icon.'),
    ),
    'direct_download_accessible' => array(
      'label' => t('Direct download file accessible'),
      'field types' => array(
        'filefield',
      ),
      'multiple values' => CONTENT_HANDLE_MODULE,
      'description' => t('Displays a link accessible to direct download the file.'),
    ),
    'direct_download_accessible_icon' => array(
      'label' => t('Direct download file accessible with the type icon'),
      'field types' => array(
        'filefield',
      ),
      'multiple values' => CONTENT_HANDLE_MODULE,
      'description' => t('Displays a link accessible to direct download the file with the type icon.'),
    ),
  );

  // ImageCache support
  if (module_exists('imagecache') && module_exists('imagefield')) {
    foreach (imagecache_presets() as $preset) {
      $formatters[$preset['presetname'] . '_imagelink_direct_download'] = array(
        'label' => t('Direct download file with thumbnail @preset', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'image',
          'filefield',
        ),
        'multiple values' => CONTENT_HANDLE_MODULE,
        'description' => t('Displays a link with a thumbnail to direct download the image.'),
      );
      $formatters[$preset['presetname'] . '_accessiblelink_direct_download'] = array(
        'label' => t('Direct download file accessible with thumbnail @preset', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'image',
          'filefield',
        ),
        'multiple values' => CONTENT_HANDLE_MODULE,
        'description' => t('Displays a link accessible with a thumbnail to direct download the image.'),
      );
    }
  }
  return $formatters;
}