You are here

function taxonomy_xml_formats in Taxonomy import/export via XML 6

Same name and namespace in other branches
  1. 5.2 taxonomy_xml.module \taxonomy_xml_formats()
  2. 5 taxonomy_xml.module \taxonomy_xml_formats()
  3. 6.2 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. More can be added as appropriate.

A taxonomy_xml *_format.inc file should prvide an implimentation of the hooks taxonomy_xml_FORMAT_parse() and/or taxonomy_xml_FORMAT_create() to support reading or writing respectively.

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 537
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;
}