You are here

function custom_formatters_field_formatter_info in Custom Formatters 6

Same name and namespace in other branches
  1. 7.2 includes/field.inc \custom_formatters_field_formatter_info()

Implements hook_field_formatter_info().

File

./custom_formatters.module, line 376
Contains core functions for the Custom Formatters module.

Code

function custom_formatters_field_formatter_info() {
  $formatters = array();
  $settings = variable_get('custom_formatters_settings', array(
    'label_prefix' => TRUE,
    'label_prefix_value' => t('Custom'),
  ));
  foreach (custom_formatters_formatters() as $formatter) {
    if ($formatter->status) {
      $label = $settings['label_prefix'] ? "{$settings['label_prefix_value']}: {$formatter->name}" : $formatter->name;
      $formatters["custom_formatters_{$formatter->name}"] = array(
        'label' => $label,
        'description' => t($formatter->description),
        'field types' => unserialize($formatter->field_types),
        'multiple values' => $formatter->multiple ? CONTENT_HANDLE_MODULE : CONTENT_HANDLE_CORE,
      );
    }
  }
  return $formatters;
}