function imagefield_crop_field_formatter_info in Imagefield Crop 6
Same name and namespace in other branches
- 7.3 imagefield_crop.module \imagefield_crop_field_formatter_info()
Implementation of hook_field_formatter_info().
imagecache formatters are named as $presetname_$style $style is used to determine how the preset should be rendered. If you are implementing custom imagecache formatters please treat _ as reserved.
@todo: move the linking functionality up to imagefield and clean up the default image integration.
File
- ./imagefield_crop.module, line 165 
Code
function imagefield_crop_field_formatter_info() {
  $formatters = array();
  $formatters = array(
    'image_uncrop_plain' => array(
      'label' => t('Image uncropped'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays image files uncropped (only for imagefield_crop files).'),
    ),
    'image_uncroplink' => array(
      'label' => t('Image linked to image uncropped'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Links to image files uncropped (only for imagefield_crop files).'),
    ),
  );
  if (function_exists('imagecache_presets')) {
    foreach (imagecache_presets() as $preset) {
      $formatters[$preset['presetname'] . '_default_uncropped'] = array(
        'label' => t('@preset image (uncropped)', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'filefield',
        ),
      );
      $formatters[$preset['presetname'] . '_linked_uncropped'] = array(
        'label' => t('@preset image linked to node (uncropped)', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'filefield',
        ),
      );
      $formatters[$preset['presetname'] . '_imagelink_uncropped'] = array(
        'label' => t('@preset image linked to image (uncropped)', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'filefield',
        ),
      );
      $formatters[$preset['presetname'] . '_path_uncropped'] = array(
        'label' => t('@preset file path (uncropped)', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'filefield',
        ),
      );
      $formatters[$preset['presetname'] . '_url_uncropped'] = array(
        'label' => t('@preset URL (uncropped)', array(
          '@preset' => $preset['presetname'],
        )),
        'field types' => array(
          'filefield',
        ),
      );
    }
  }
  return $formatters;
}