You are here

function styles_field_formatter_info in Styles 7

Same name and namespace in other branches
  1. 6.2 styles.module \styles_field_formatter_info()
  2. 6 styles.module \styles_field_formatter_info()
  3. 7.2 styles.module \styles_field_formatter_info()

Implements hook_field_formatter_info().

File

./styles.module, line 36
Bundles similar display formatters together.

Code

function styles_field_formatter_info() {
  $info = array();
  $presets = styles_presets();
  foreach ($presets as $field_type => $styles) {
    foreach ($styles as $style_name => $style) {
      $info['styles_' . $field_type . '_' . $style_name] = array(
        'label' => t('@field Style: @style', array(
          '@field' => ucfirst($field_type),
          '@style' => $style_name,
        )),
        'field types' => array(
          $field_type,
        ),
        'behaviors' => array(
          'multiple values' => FIELD_BEHAVIOR_DEFAULT,
        ),
        'theme' => array(
          'function' => 'theme_styles_field_formatter',
        ),
      );
    }
  }
  return $info;
}