diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-05-18 14:58:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-05-18 14:58:57 +0000 |
commit | 1b291a2917a1c18194c54fce8bf0fd895db98019 (patch) | |
tree | a46473123aeb5709f8cc6f07e685fc84df90bf06 /modules/taxonomy.module | |
parent | be7bb9be9bb41c83795fa8d7fa119ce4025f2de0 (diff) | |
download | brdo-1b291a2917a1c18194c54fce8bf0fd895db98019.tar.gz brdo-1b291a2917a1c18194c54fce8bf0fd895db98019.tar.bz2 |
- Patch #18260 by Ber, m3averck et al: allow overriding of links returned by modules
Diffstat (limited to 'modules/taxonomy.module')
-rw-r--r-- | modules/taxonomy.module | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 29ccd3ae0..d917c7511 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -29,19 +29,22 @@ function taxonomy_link($type, $node = NULL) { $links = array(); if (array_key_exists('taxonomy', $node)) { foreach ($node->taxonomy as $term) { - $links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description))); + $links['taxonomy_term_'. $term->tid] = array( + '#title' => $term->name, + '#href' => 'taxonomy/term/'. $term->tid, + '#attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) + ); } } - return $links; - } -} -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; + // We call this hook again because some modules and themes call taxonomy_link('taxonomy terms') directly + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $links); + } + + return $links; } - return 'taxonomy/term/'. $term->tid; } /** |