You are here

function fe_taxonomy_vocabulary_features_export in Features Extra 6

Implementation of hook_features_export().

File

./fe_taxonomy.module, line 59

Code

function fe_taxonomy_vocabulary_features_export($data, &$export, $module_name = '') {
  $pipe = array();
  $export['dependencies']['fe_taxonomy'] = 'fe_taxonomy';
  $table = 'fe_taxonomy_vocabulary';

  // Add the components
  foreach ($data as $object_name) {
    $export['features'][$table][$object_name] = $object_name;

    // Add dependency
    $vocab_module = db_result(db_query("SELECT v.module FROM {{$table}} {$table} INNER JOIN {vocabulary} v ON v.vid = {$table}.vid WHERE {$table}.machine_name = '%s'", $object_name));
    if (!empty($vocab_module) && !in_array($vocab_module, array(
      'taxonomy',
      'fe_taxonomy',
    ))) {
      $export['dependencies'][$vocab_module] = $vocab_module;
    }
  }
  return $pipe;
}