You are here

function _uc_importer_export_vocabularies in Ubercart 5

Export vocabularies as XML.

1 call to _uc_importer_export_vocabularies()
uc_importer_export in uc_importer/uc_importer.module
Constructs the XML representation of the store from the ids given.

File

uc_importer/uc_importer.module, line 439
XML product importer and exporter.

Code

function _uc_importer_export_vocabularies($vocabularies) {
  $xml .= '<vocabularies>';
  foreach ($vocabularies as $vid) {
    $xml .= '<vocabulary>';
    $vocabulary = taxonomy_get_vocabulary($vid);
    $xml .= '<id>' . $vocabulary->vid . '</id>';
    $xml .= '<name>' . htmlspecialchars($vocabulary->name, ENT_QUOTES, "UTF-8") . '</name>';
    $xml .= '<description>' . htmlspecialchars($vocabulary->description, ENT_QUOTES, "UTF-8") . '</description>';
    $xml .= '<relations>' . htmlspecialchars($vocabulary->relations, ENT_QUOTES, "UTF-8") . '</relations>';
    $xml .= '<hierarchy>' . $vocabulary->hierarchy . '</hierarchy>';
    $xml .= '<multiple>' . $vocabulary->multiple . '</multiple>';
    $xml .= '<required>' . $vocabulary->required . '</required>';
    $xml .= '<tags>' . $vocabulary->tags . '</tags>';
    $xml .= '<weight>' . $vocabulary->weight . '</weight>';
    foreach ($vocabulary->nodes as $type) {
      $xml .= '<nodes>' . $type . '</nodes>';
    }
    $xml .= uc_importer_invoke('export', 'vocabulary', $vid);
    $xml .= '</vocabulary>';
  }
  $xml .= '</vocabularies>';
  return $xml;
}