You are here

function taxonomy_manager_export_csv in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.admin.inc \taxonomy_manager_export_csv()
  2. 6 taxonomy_manager.admin.inc \taxonomy_manager_export_csv()
  3. 7 taxonomy_manager.admin.inc \taxonomy_manager_export_csv()

Generates the CVS Ouput

1 call to taxonomy_manager_export_csv()
taxonomy_manager_export in ./taxonomy_manager.module
AJAX Callback that returns the CSV Output

File

./taxonomy_manager.module, line 1477
Taxonomy Manager

Code

function taxonomy_manager_export_csv($delimiter = ";", $vid, $selected_tid = 0, $options = array()) {
  $tree = taxonomy_manager_export_get_tree($vid, $selected_tid, $options);
  foreach ($tree as $term) {
    $array = array();
    $array[] = '"' . $term->vid . '"';
    $array[] = '"' . $term->tid . '"';
    $array[] = '"' . $term->name . '"';
    $array[] = '"' . $term->description . '"';
    foreach ($term->parents as $parent) {
      $array[] = '"' . $parent . '"';
    }
    $output .= implode($delimiter, $array) . "\n";
  }
  return $output;
}