features.inc 671 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * @file
  4. * Features module integration.
  5. */
  6. /**
  7. * Implements hook_features_pipe_field_alter().
  8. *
  9. * This determines whether exported fields contain File (Field) Paths settings
  10. * and if so adds File (Field) Paths as a dependency.
  11. */
  12. function filefield_paths_features_pipe_field_alter(&$pipe, $data, &$export) {
  13. foreach ($data as $field_identifier) {
  14. list($entity_type, $bundle_name, $field_name) = explode('-', $field_identifier);
  15. $instance = field_info_instance($entity_type, $field_name, $bundle_name);
  16. if (isset($instance['settings']['filefield_paths'])) {
  17. $export['dependencies']['filefield_paths'] = 'filefield_paths';
  18. }
  19. }
  20. }