function taxonomy_xml_taxonomy_vocabulary_uri in Taxonomy import/export via XML 6.2
Entity uri callback.
2 calls to taxonomy_xml_taxonomy_vocabulary_uri()
- taxonomy_xml_add_terms_as_rdf in ./
rdf_format.inc - Given a list of terms, append definitions of them to the passed DOM container
- taxonomy_xml_add_vocab_as_rdf in ./
rdf_format.inc - Create a vocabulary definition (just the def, not its terms) and insert it into the given document element.
1 string reference to 'taxonomy_xml_taxonomy_vocabulary_uri'
- taxonomy_xml_rdf_mapping in ./
taxonomy_xml.module - Implements hook_rdf_mapping().
File
- ./
rdf_format.inc, line 1376 - Include routines for RDF parsing and taxonomy/term creation. @author dman http://coders.co.nz
Code
function taxonomy_xml_taxonomy_vocabulary_uri($vocabulary) {
if (is_numeric($vocabulary)) {
$vocabulary = taxonomy_vocabulary_load($vocabulary);
}
$vocabulary->machine_name = 'vocabulary-' . preg_replace('/[^a-z0-9]+/', '_', strtolower($vocabulary->name));
// If it is a features vocabulary, its cannonic ID is overloaded in the 'module' field.
// Makes enough sense. Use that
if (strpos($vocabulary->module, 'features_') === 0) {
// Simply display the existing machine name if we have one.
$vocabulary->machine_name = substr($vocabulary->module, 9);
}
return array(
'path' => 'taxonomy/vocabulary/' . $vocabulary->vid,
'title' => $vocabulary->name,
'id' => $vocabulary->machine_name,
);
}