You are here

function ctools_fields_get_field_formatter_info in Chaos Tool Suite (ctools) 7

Helper function for generating all the formatter information associated with any fields. Especially useful for determining the fields that will be added to form that executes hook_field_formatter_settings_form().

Parameters

$fields: An array of fully loaded fields.

1 call to ctools_fields_get_field_formatter_info()
ctools_entity_field_content_type_formatter_styles_submit in plugins/content_types/entity_context/entity_field.inc

File

includes/fields.inc, line 140
Extend core fields with some helper functions to reduce code complexity within views and ctools plugins.

Code

function ctools_fields_get_field_formatter_info($fields) {
  $info = array();
  $field_info = field_info_formatter_types();
  foreach ($fields as $field) {
    foreach ($field_info as $format_name => $formatter_info) {
      if (in_array($field['type'], $formatter_info['field types'])) {
        $info += array(
          $format_name => $formatter_info,
        );
      }
    }
  }
  return $info;
}