You are here

function filefield_paths_features_pipe_content_alter in File (Field) Paths 6

Attach our own export routine as a piped export that happens below any cck filefield path that is getting exported.

The component name for cck fields is 'content'

HOOK_features_pipe_COMPONENT_alter()

This captures each cck field export, and adds ourself to the dependencies and exports when that field is exported.

File

modules/features.inc, line 97
Features module integration.

Code

function filefield_paths_features_pipe_content_alter(&$pipe, $data, $export) {
  foreach ($data as $field_identifier) {

    // CCK field export is exporting a field named $field_identifier.
    // If that is a filefield, we should attach ourselves as a subprocess (pipe).
    // .. actually, don't need to check the field type,
    // just see if we have some filefield_path
    // settings that use the same $field_identifier key!
    if (filefield_paths_load($field_identifier)) {

      // So add this setting as a piped child of the filed when it gets exported.
      $pipe['filefield_paths'][$field_identifier] = $field_identifier;
    }
  }
}