You are here

function imagecache_field_formatter_info in ImageCache 5.2

Same name and namespace in other branches
  1. 5 imagecache.module \imagecache_field_formatter_info()
  2. 6.2 imagecache.module \imagecache_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

./imagecache.module, line 537
Dynamic image resizer and image cacher.

Code

function imagecache_field_formatter_info() {
  foreach (imagecache_presets() as $preset) {
    $formatters[$preset['presetname'] . '_default'] = array(
      'label' => $preset['presetname'],
      'field types' => array(
        'image',
      ),
    );
    $formatters[$preset['presetname'] . '_linked'] = array(
      'label' => t('@preset as link to node', array(
        '@preset' => $preset['presetname'],
      )),
      'field types' => array(
        'image',
      ),
    );
    $formatters[$preset['presetname'] . '_imagelink'] = array(
      'label' => t('@preset as link to image', array(
        '@preset' => $preset['presetname'],
      )),
      'field types' => array(
        'image',
      ),
    );
    $formatters[$preset['presetname'] . '_path'] = array(
      'label' => t('path to @preset derivative', array(
        '@preset' => $preset['presetname'],
      )),
      'field types' => array(
        'image',
      ),
    );
    $formatters[$preset['presetname'] . '_url'] = array(
      'label' => t('url to @preset derivative', array(
        '@preset' => $preset['presetname'],
      )),
      'field types' => array(
        'image',
      ),
    );
  }
  return $formatters;
}