| 1 |
<?php |
<?php |
| 2 |
// $Id: $ |
// $Id: taxonomy_breadcrumb.inc,v 1.1 2009/01/12 02:19:26 mgn Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 15 |
*/ |
*/ |
| 16 |
function _taxonomy_breadcrumb_term_page($str_tids = '', $depth = 0, $op = 'page') { |
function _taxonomy_breadcrumb_term_page($str_tids = '', $depth = 0, $op = 'page') { |
| 17 |
// Include the .inc file with all helper functions |
// Include the .inc file with all helper functions |
| 18 |
require_once drupal_get_path('module', 'taxonomy') .'/taxonomy.pages.inc'; |
require_once(drupal_get_path('module', 'taxonomy') .'/taxonomy.pages.inc'); |
| 19 |
|
|
| 20 |
// Call the core taxonomy_term_page function |
// Call the core taxonomy_term_page function |
| 21 |
$output = taxonomy_term_page($str_tids, $depth, $op); |
$output = taxonomy_term_page($str_tids, $depth, $op); |
| 84 |
$vocabulary_path = _taxonomy_breadcrumb_get_vocabulary_path($term->vid); |
$vocabulary_path = _taxonomy_breadcrumb_get_vocabulary_path($term->vid); |
| 85 |
if ($vocabulary_path != NULL) { |
if ($vocabulary_path != NULL) { |
| 86 |
$vocabulary = taxonomy_vocabulary_load($term->vid); |
$vocabulary = taxonomy_vocabulary_load($term->vid); |
| 87 |
$breadcrumb[] = l($vocabulary->name, $vocabulary_path); |
$breadcrumb[] = l(_taxonomy_breadcrumb_tt("taxonomy:vocabulary:$term->tid:name", $vocabulary->name), $vocabulary_path); |
| 88 |
} |
} |
| 89 |
|
|
| 90 |
// TERM breadcrumb generation |
// TERM breadcrumb generation |
| 96 |
} |
} |
| 97 |
// Do not create links to own self if we are on a taxonomy/term page. |
// Do not create links to own self if we are on a taxonomy/term page. |
| 98 |
if ($is_term_page && $parent_term->tid == $tid) { |
if ($is_term_page && $parent_term->tid == $tid) { |
| 99 |
$breadcrumb[] = $parent_term->name; |
$breadcrumb[] = _taxonomy_breadcrumb_tt("taxonomy:term:$parent_term->tid:name", $parent_term->name); |
| 100 |
} |
} |
| 101 |
else { |
else { |
| 102 |
$breadcrumb[] = l($parent_term->name, $term_path); |
$breadcrumb[] = l(_taxonomy_breadcrumb_tt("taxonomy:term:$parent_term->tid:name", $parent_term->name), $term_path); |
| 103 |
} |
} |
| 104 |
} |
} |
| 105 |
|
|
| 110 |
return $breadcrumb; |
return $breadcrumb; |
| 111 |
|
|
| 112 |
} |
} |
| 113 |
|
|
| 114 |
|
|
| 115 |
|
/** |
| 116 |
|
* Helper function for when i18ntaxonomy module is not installed. |
| 117 |
|
*/ |
| 118 |
|
|
| 119 |
|
function _taxonomy_breadcrumb_tt($string_id, $default, $language = NULL) { |
| 120 |
|
|
| 121 |
|
return function_exists('tt') ? tt($string_id, $default, $language) : $default; |
| 122 |
|
} |