You are here

function fe_taxonomy_vocabulary_features_export_options in Features Extra 6

Implementation of hook_features_export_options().

File

./fe_taxonomy.module, line 33

Code

function fe_taxonomy_vocabulary_features_export_options() {
  $table = 'fe_taxonomy_vocabulary';
  $options = array();

  // Defaults.
  $schema = ctools_export_get_schema($table);
  $export = $schema['export'];
  $defaults = _ctools_export_get_defaults($table, $export);
  foreach ($defaults as $obj) {
    $options[$obj->machine_name] = t('@name [@machine_name]', array(
      '@name' => $obj->name,
      '@machine_name' => $obj->machine_name,
    ));
  }

  // Normals.
  $query = "SELECT * FROM {{$table}} {$table} INNER JOIN {vocabulary} v ON v.vid = {$table}.vid ORDER BY v.vid ASC";
  $result = db_query($query);
  while ($obj = db_fetch_object($result)) {
    $options[$obj->machine_name] = t('@name [@machine_name]', array(
      '@name' => $obj->name,
      '@machine_name' => $obj->machine_name,
    ));
  }
  ksort($options);
  return $options;
}