You are here

function custom_formatters_features_pipe_views_alter in Custom Formatters 6

Implements hook_features_pipe_component_alter().

File

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

Code

function custom_formatters_features_pipe_views_alter(&$pipe, $data, $export) {
  foreach ($data as $view) {
    $view = views_get_view($view);
    foreach ($view->display as $display) {
      if ($display->display_options['fields']) {
        foreach ($display->display_options['fields'] as $field) {
          if (isset($field['format'])) {
            $name = drupal_substr($field['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;
            }
          }
        }
      }
    }
  }
}