function taxonomy_menu_path_default in Taxonomy menu 6.2
Same name and namespace in other branches
- 8 taxonomy_menu.module \taxonomy_menu_path_default()
- 6.3 taxonomy_menu.module \taxonomy_menu_path_default()
- 7.2 taxonomy_menu.module \taxonomy_menu_path_default()
- 7 taxonomy_menu.module \taxonomy_menu_path_default()
Callback for hook_taxonomy_menu_path
1 string reference to 'taxonomy_menu_path_default'
- taxonomy_menu_create_path in ./
taxonomy_menu.module - Create the path for the vid/tid combination.
File
- ./
taxonomy_menu.module, line 640 - It Generates menu links for all selected taxonomy terms
Code
function taxonomy_menu_path_default($vid, $tid) {
// if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....
if ($tid == 0) {
// get all of the terms for the vocab
$vtids = _taxonomy_menu_get_terms($vid);
$end = implode(' ', $vtids);
$path = "taxonomy/term/{$end}";
}
else {
$path = taxonomy_term_path(taxonomy_get_term($tid));
if (variable_get('taxonomy_menu_display_descendants_' . $vid, FALSE)) {
// Use 'all' at the end of the path
if (variable_get('taxonomy_menu_end_all_' . $vid, FALSE)) {
$path .= '/all';
}
else {
// we wait to run this instead of durning the if above
// because we only wan to run it once.
$terms = taxonomy_get_tree($vid, $tid);
foreach ($terms as $term) {
$tids[] = $term->tid;
}
if ($tids) {
$end = implode(' ', $tids);
$path .= ' ' . $end;
}
}
}
}
return $path;
}