function taxonomy_csv_format_check in Taxonomy CSV import/export 6.2
Same name and namespace in other branches
- 6.5 taxonomy_csv.api.inc \taxonomy_csv_format_check()
- 6.3 taxonomy_csv.api.inc \taxonomy_csv_format_check()
- 6.4 taxonomy_csv.api.inc \taxonomy_csv_format_check()
Helper to include format files each time it's needed and to check function.
Parameters
$format: String. Format to check and include.
$funcname: (Optional) String. Function to check if needed.
Return value
TRUE if no error, FALSE else.
6 calls to taxonomy_csv_format_check()
- taxonomy_csv_formats_get in ./
taxonomy_csv.api.inc - Fetch available external formats.
- taxonomy_csv_line_import in import/
taxonomy_csv.import.line.api.inc - Process the import of items.
- taxonomy_csv_term_export in export/
taxonomy_csv.export.api.inc - Export a term to a line matching the options.
- taxonomy_csv_term_import in import/
taxonomy_csv.import.line.api.inc - Update or create a term with the given name in the given vocabulary and given parent.
- _taxonomy_csv_import_vocabulary_prepare in import/
taxonomy_csv.import.api.inc - Prepare a vocabulary for import.
File
- ./
taxonomy_csv.api.inc, line 349 - Manage variables and features of module.
Code
function taxonomy_csv_format_check($format, $funcname = '') {
$module_dir = drupal_get_path('module', 'taxonomy_csv');
$file = "{$module_dir}/formats/{$format}.format.inc";
if (file_exists($file)) {
include_once $file;
if ($funcname == '') {
return TRUE;
}
if (function_exists($funcname)) {
return TRUE;
}
}
return FALSE;
}