You are here

function imagefield_extended_field_formatter_info in ImageField Extended 6.4

Same name and namespace in other branches
  1. 6.3 imagefield_extended.module \imagefield_extended_field_formatter_info()

Implementation of hook_field_formatter_info().

File

./imagefield_extended.module, line 74
Insert additional fields into a FileField / ImageField data array.

Code

function imagefield_extended_field_formatter_info() {
  $formatters = array(
    'ife' => array(
      'label' => t('Image, with additional fields'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays image files in their original size.'),
    ),
  );

  // Add imagecache support.
  if (module_exists('imagecache')) {
    $rules = array();
    if (function_exists('imagecache_presets')) {
      foreach (imagecache_presets() as $preset_id => $preset_info) {
        $rules[$preset_id] = $preset_info['presetname'];
      }
    }
    else {
      $rules = _imagecache_get_presets();
    }
    foreach ($rules as $preset_id => $preset) {
      $formatters[$preset . '_ife'] = array(
        'label' => t('@preset image, with additional fields', array(
          '@preset' => $preset,
        )),
        'field types' => array(
          'filefield',
        ),
      );
    }
  }
  return $formatters;
}