You are here

function taxonomy_xml_formats in Taxonomy import/export via XML 5

Same name and namespace in other branches
  1. 5.2 taxonomy_xml.module \taxonomy_xml_formats()
  2. 6.2 taxonomy_xml.module \taxonomy_xml_formats()
  3. 6 taxonomy_xml.module \taxonomy_xml_formats()
  4. 7 taxonomy_xml.module \taxonomy_xml_formats()

Return a list of available file formats.

Scan the module directory for appropriate inc files.

Return value

Array ( [csv_format] => CSV [rdf_format] => RDF [xml_format] => XML )

1 call to taxonomy_xml_formats()
taxonomy_xml_import_form in ./taxonomy_xml.module
Builds the import form.

File

./taxonomy_xml.module, line 308
taxonomy_xml.module This module makes it possible to import and export taxonomies as XML documents.

Code

function taxonomy_xml_formats() {
  $incs = file_scan_directory(dirname(drupal_get_filename('module', 'taxonomy_xml')), '.*_format.inc');
  $formats = array();
  foreach ($incs as $file) {
    $formats[$file->name] = strtoupper(preg_replace('/_format$/', '', $file->name));
  }
  return $formats;
}