You are here

function taxonomy_configuration_export in Configuration Management 7

Implements hook_configuration_export().

@todo Test adding existing dependencies.

File

includes/configuration.taxonomy.inc, line 33

Code

function taxonomy_configuration_export($data, &$export, $module_name = '') {
  $pipe = array();

  // taxonomy_default_vocabularies integration is provided by configuration.
  $export['dependencies']['configuration'] = 'configuration';
  $export['dependencies']['taxonomy'] = 'taxonomy';

  // Add dependencies for each vocabulary.
  $map = configuration_get_default_map('taxonomy');
  foreach ($data as $machine_name) {
    if (isset($map[$machine_name]) && $map[$machine_name] != $module_name) {
      $export['dependencies'][$map[$machine_name]] = $map[$machine_name];
    }
    $export['configuration']['taxonomy'][$machine_name] = $machine_name;
    $fields = field_info_instances('taxonomy_term', $machine_name);
    foreach ($fields as $name => $field) {
      $pipe['field'][] = "taxonomy_term-{$field['bundle']}-{$field['field_name']}";
    }
  }
  return $pipe;
}