You are here

function taxonomy_manager_export_csv in Taxonomy Manager 7

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

Generates the CVS Ouput

1 call to taxonomy_manager_export_csv()
taxonomy_manager_export_form_submit in ./taxonomy_manager.admin.inc
Submit handler for the export form.

File

./taxonomy_manager.admin.inc, line 2731

Code

function taxonomy_manager_export_csv($tree, $delimiter = ";") {
  $output = "";
  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;
}