You are here

function synonyms_features_export in Synonyms 7

Implements hook_features_export().

File

./synonyms.features.inc, line 11
Synonyms module integration with Features.

Code

function synonyms_features_export($data, &$export, $module_name) {
  $pipe = array();
  $export['features']['synonyms'] = array();
  foreach ($data as $v) {
    list($entity_type, $bundle, $provider, $behavior) = explode(':', $v);
    $behavior_definition = synonyms_behaviors();
    $behavior_definition = $behavior_definition[$behavior];
    $export['dependencies'][] = $behavior_definition['module'];
    $export['features']['synonyms'][$v] = $v;
    $behavior_implementation = synonyms_behavior_get_all_enabled($entity_type, $bundle, $provider, $behavior);
    $behavior_implementation = reset($behavior_implementation);
    $provider_info = synonyms_behavior_implementation_info($entity_type, $bundle, $behavior);
    $provider_info = $provider_info[$provider];
    $export['dependencies'][] = $provider_info['module'];
    $pipe = array_merge_recursive($pipe, $behavior_implementation['object']
      ->featuresExportPipe());
  }
  $export['dependencies'][] = 'synonyms';
  $export['dependencies'] = drupal_map_assoc(array_unique($export['dependencies']));
  return $pipe;
}