features.inc 1010 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Features module integration.
  5. */
  6. /**
  7. * Implements hook_features_pipe_field_instance_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. * @param $pipe
  13. * @param $data
  14. * @param $export
  15. */
  16. function filefield_paths_features_pipe_field_instance_alter(&$pipe, $data, &$export) {
  17. foreach ($data as $field_identifier) {
  18. list($entity_type, $bundle_name, $field_name) = explode('-', $field_identifier);
  19. $instance = field_info_instance($entity_type, $field_name, $bundle_name);
  20. if (isset($instance['settings']['filefield_paths'])) {
  21. $export['dependencies']['filefield_paths'] = 'filefield_paths';
  22. }
  23. }
  24. }
  25. /**
  26. * Implements hook_features_pipe_field_alter().
  27. *
  28. * @param $pipe
  29. * @param $data
  30. * @param $export
  31. */
  32. function filefield_paths_features_pipe_field_alter(&$pipe, $data, &$export) {
  33. filefield_paths_features_pipe_field_instance_alter($pipe, $data, $export);
  34. }