#197864 by vito_swat, alpritt, Murz, catch: Use hook_term_path() in forum module instead of hook_link_alter(); simplfies code, improves performance and compatibility.
parent
8b2d04f365
commit
3a4912c843
|
@ -645,18 +645,8 @@ function _forum_parent_select($tid, $title, $child_type) {
|
||||||
return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE);
|
return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
function forum_link_alter(&$node, &$links) {
|
function forum_term_path($term) {
|
||||||
foreach ($links as $module => $link) {
|
return 'forum/'. $term->tid;
|
||||||
if (strstr($module, 'taxonomy_term')) {
|
|
||||||
// Link back to the forum and not the taxonomy term page. We'll only
|
|
||||||
// do this if the taxonomy term in question belongs to forums.
|
|
||||||
$tid = str_replace('taxonomy/term/', '', $link['href']);
|
|
||||||
$term = taxonomy_get_term($tid);
|
|
||||||
if ($term->vid == _forum_get_vid()) {
|
|
||||||
$links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue