diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-02 01:13:45 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-02 01:13:45 +0000 |
commit | 685be2ffcefb686a903f9192343dd4477450029b (patch) | |
tree | f0c60dcd31108d6a5729f3b4c049885512c0ac81 | |
parent | 1e34796ada209f46eef1e118136ef3a22e2ababf (diff) | |
download | brdo-685be2ffcefb686a903f9192343dd4477450029b.tar.gz brdo-685be2ffcefb686a903f9192343dd4477450029b.tar.bz2 |
#71728 by Eaton, re-add taxonomy_term_path()
-rw-r--r-- | modules/taxonomy.module | 10 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index c2920a7c0..ebcf4dd9c 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -31,7 +31,7 @@ function taxonomy_link($type, $node = NULL) { foreach ($node->taxonomy as $term) { $links['taxonomy_term_'. $term->tid] = array( '#title' => $term->name, - '#href' => 'taxonomy/term/'. $term->tid, + '#href' => taxonomy_term_path($term), '#attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) ); } @@ -47,6 +47,14 @@ function taxonomy_link($type, $node = NULL) { } } +function taxonomy_term_path($term) { + $vocabulary = taxonomy_get_vocabulary($term->vid); + if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) { + return $path; + } + return 'taxonomy/term/'. $term->tid; +} + /** * Implementation of hook_menu(). */ diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index c2920a7c0..ebcf4dd9c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -31,7 +31,7 @@ function taxonomy_link($type, $node = NULL) { foreach ($node->taxonomy as $term) { $links['taxonomy_term_'. $term->tid] = array( '#title' => $term->name, - '#href' => 'taxonomy/term/'. $term->tid, + '#href' => taxonomy_term_path($term), '#attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) ); } @@ -47,6 +47,14 @@ function taxonomy_link($type, $node = NULL) { } } +function taxonomy_term_path($term) { + $vocabulary = taxonomy_get_vocabulary($term->vid); + if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) { + return $path; + } + return 'taxonomy/term/'. $term->tid; +} + /** * Implementation of hook_menu(). */ |