features.inc 792 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * @file
  4. * Features module integration.
  5. */
  6. /**
  7. * Implements hook_features_pipe_component_alter().
  8. */
  9. function custom_formatters_features_pipe_field_alter(&$pipe, $data, $export) {
  10. foreach ($data as $id) {
  11. list($entity_type, $bundle_name, $field_name) = explode('-', $id);
  12. $field = field_info_instance($entity_type, $field_name, $bundle_name);
  13. foreach ($field['display'] as $display) {
  14. if (isset($display['module']) && $display['module'] == 'custom_formatters') {
  15. $formatter = custom_formatters_crud_load(drupal_substr($display['type'], 18));
  16. if ($formatter && isset($formatter->export_type) && $formatter->export_type == EXPORT_IN_DATABASE) {
  17. $pipe['formatters'][$formatter->name] = $formatter->name;
  18. }
  19. }
  20. }
  21. }
  22. }