You are here

function custom_formatters_features_pipe_content_alter in Custom Formatters 6

Implements hook_features_pipe_component_alter().

File

includes/features.inc, line 81
Provides Custom Formatters integration with the Features module.

Code

function custom_formatters_features_pipe_content_alter(&$pipe, $data, $export) {
  foreach ($data as $field) {
    $args = explode('-', $field);
    $field = content_fields($args[1], $args[0]);
    foreach ($field['display_settings'] as $child) {
      if (is_array($child) && isset($child['format']) && strpos($child['format'], 'custom_formatters_') === 0) {
        $name = drupal_substr($child['format'], 18);
        if (is_object(custom_formatters_formatter($name)) && !in_array($name, array_keys(module_invoke_all('custom_formatters_defaults')))) {
          $pipe['custom_formatters'][$name] = $name;
        }
      }
    }
  }
}