From 1b291a2917a1c18194c54fce8bf0fd895db98019 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 18 May 2006 14:58:57 +0000 Subject: - Patch #18260 by Ber, m3averck et al: allow overriding of links returned by modules --- modules/taxonomy.module | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'modules/taxonomy.module') 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; } /** -- cgit v1.2.3