You are here

function taxonomy_xml_export in Taxonomy import/export via XML 5.2

Same name and namespace in other branches
  1. 5 taxonomy_xml.module \taxonomy_xml_export()
  2. 6.2 taxonomy_xml.module \taxonomy_xml_export()
  3. 6 taxonomy_xml.module \taxonomy_xml_export()
  4. 7 taxonomy_xml.export.inc \taxonomy_xml_export()

taxonomy_xml_export

Outputs an unordered list of all available vocabularies for export

Return value

An unordered HTML list

1 string reference to 'taxonomy_xml_export'
taxonomy_xml_menu in ./taxonomy_xml.module
Implementation of hook_menu: Define menu links.

File

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

Code

function taxonomy_xml_export() {

  // return the list of vocabularies
  $output = '';
  $vocabularies = module_invoke('taxonomy', 'get_vocabularies');
  if (empty($vocabularies)) {
    $output .= t('There are no vocabularies present');
  }
  else {
    foreach ($vocabularies as $vocabulary) {
      $vocablist[$vocabulary->vid] = l($vocabulary->name, "taxonomy_xml/{$vocabulary->vid}");
      $vocablist[$vocabulary->vid] .= ' ' . l("RDF", "taxonomy_xml/{$vocabulary->vid}/rdf");
    }
    $output = theme_item_list($vocablist);
  }
  return $output;
}