diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-19 18:28:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-19 18:28:16 +0000 |
commit | 24669bfb50d643330cd50cbeea21d19d51107a36 (patch) | |
tree | 93eca4ca9d1a4b409b6ee4aac75362080136a5a4 /modules/taxonomy/taxonomy.module | |
parent | 0b750209b6ead13c836852eb96bc6cc8f14de51f (diff) | |
download | brdo-24669bfb50d643330cd50cbeea21d19d51107a36.tar.gz brdo-24669bfb50d643330cd50cbeea21d19d51107a36.tar.bz2 |
- Patch #493030 by scor, Stefan Freudenberg, pwolanin, fago, Benjamin Melançon, kriskras, dmitrig01, sun: added RDFa support to Drupal core. Oh my, oh my.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 69025f6bb..8a4bbd11c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1102,7 +1102,8 @@ function taxonomy_field_formatter_info() { */ function theme_field_formatter_taxonomy_term_link($variables) { $term = $variables['element']['#item']['taxonomy_term']; - return l($term->name, taxonomy_term_path($term)); + $attributes = empty($variables['link_options']) ? array() : $variables['link_options']; + return l($term->name, taxonomy_term_path($term), $attributes); } /** @@ -1406,6 +1407,47 @@ function taxonomy_field_settings_form($field, $instance, $has_data) { } /** + * Implement hook_rdf_mapping(). + * + * @return array + * The rdf mapping for vocabularies and terms. + */ +function taxonomy_rdf_mapping() { + return array( + array( + 'type' => 'taxonomy_term', + 'bundle' => RDF_DEFAULT_BUNDLE, + 'mapping' => array( + 'rdftype' => array('skos:Concept'), + 'name' => array( + 'predicates' => array('skos:prefLabel'), + ), + 'description' => array( + 'predicates' => array('skos:definition'), + ), + // The vocabulary this term belongs to. + 'vid' => array( + 'predicates' => array('skos:member'), + ), + ), + ), + array( + 'type' => 'taxonomy_vocabulary', + 'bundle' => RDF_DEFAULT_BUNDLE, + 'mapping' => array( + 'rdftype' => array('skos:Collection'), + 'name' => array( + 'predicates' => array('rdfs:label'), + ), + 'description' => array( + 'predicates' => array('rdfs:comment'), + ), + ), + ), + ); +} + +/** * @defgroup taxonomy indexing Taxonomy functions maintaining {taxonomy_index}. * * Taxonomy uses default field storage to store canonical relationships @@ -1495,4 +1537,3 @@ function taxonomy_taxonomy_term_delete($term) { /** * @} End of "defgroup taxonomy indexing" */ - |