function taxonomy_csv_export in Taxonomy CSV import/export 7.5
Same name and namespace in other branches
- 6.5 export/taxonomy_csv.export.api.inc \taxonomy_csv_export()
- 6.2 export/taxonomy_csv.export.api.inc \taxonomy_csv_export()
- 6.3 export/taxonomy_csv.export.api.inc \taxonomy_csv_export()
- 6.4 export/taxonomy_csv.export.api.inc \taxonomy_csv_export()
- 7.4 export/taxonomy_csv.export.api.inc \taxonomy_csv_export()
Process the export of a vocabulary.
If not used in a form, don't forget to use batch_process().
Parameters
$options: An associative array of options:
- export_format : see format of the csv line (see taxonomy.api.inc)
- vocabulary_id : vid or machine_name (or array of them) of the vocabulary to export (default: 0, which means all)
- delimiter : one character csv delimiter (default: ',')
- enclosure : zero or one character csv enclosure (default: '"')
- line_ending : 'Unix' (default), 'Mac' or 'MS-DOS'
- order : order of terms: 'name' (default), 'tid' or 'weight'
// Level of result process infos:
- check_options : boolean. check or not (default) this array of options
- result_display: boolean. display or not (default). Only used with UI
- result_duplicates: boolean. display or not (default) duplicate terms
All options have default values. Warning: default values are different with UI.
Return value
Array of errors or file object to download (need to execute batch process; result is logged in watchdog).
1 call to taxonomy_csv_export()
- drush_taxonomy_csv_export in ./
taxonomy_csv.drush.inc - Process the export of a vocabulary.
File
- export/
taxonomy_csv.export.api.inc, line 41 - Validate export options and manage export process.
Code
function taxonomy_csv_export($options) {
// Complete $options with default values if needed.
// Default api and UI options are different.
$options += _taxonomy_csv_values('export_default_api');
// Presave a file in order to check access to temporary folder.
$messages = _taxonomy_csv_export_output_presave($options);
if (count($messages)) {
return $messages;
}
// Process export.
$messages = taxonomy_csv_vocabulary_export($options);
// Return errors if any.
if (count($messages)) {
return $messages;
}
else {
return $options['file'];
}
}