From 4e187261abc63432130bd3b5661b622ba095ffeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 25 Oct 2007 08:24:43 +0000 Subject: #177497 by chx and Desbeers: revive Drupal 5's menu_set_location() functionality by introducing menu_set_item() (for consistency in function naming), thus fixing a regression in the current development code. Also fixing some misuse of menu_set_location() by using drupal_set_breadcrumb() instead. --- modules/forum/forum.module | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 600ae5a46..e7b3bb683 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -184,16 +184,15 @@ function forum_nodeapi(&$node, $op, $teaser, $page) { } } // Breadcrumb navigation - $breadcrumb = array(); - $breadcrumb[] = array('path' => 'forum', 'title' => $vocabulary->name); + $breadcrumb[] = l(t('Home'), NULL); + $breadcrumb[] = l($vocabulary->name, 'forum'); if ($parents = taxonomy_get_parents_all($node->tid)) { $parents = array_reverse($parents); foreach ($parents as $p) { - $breadcrumb[] = array('path' => 'forum/'. $p->tid, 'title' => $p->name); + $breadcrumb[] = l($p->name, 'forum/'.$p->tid); } } - $breadcrumb[] = array('path' => 'node/'. $node->nid); - menu_set_location($breadcrumb); + drupal_set_breadcrumb($breadcrumb); if (!$teaser) { $node->content['forum_navigation'] = array( @@ -628,11 +627,10 @@ function template_preprocess_forums(&$variables) { $title = !empty($vocabulary->name) ? $vocabulary->name : ''; // Breadcrumb navigation: - $breadcrumb = array(); + $breadcrumb[] = l(t('Home'), NULL); if ($variables['tid']) { - $breadcrumb[] = array('path' => 'forum', 'title' => $title); + $breadcrumb[] = l($vocabulary->name, 'forum'); } - if ($variables['parents']) { $variables['parents'] = array_reverse($variables['parents']); foreach ($variables['parents'] as $p) { @@ -640,16 +638,13 @@ function template_preprocess_forums(&$variables) { $title = $p->name; } else { - $breadcrumb[] = array('path' => 'forum/'. $p->tid, 'title' => $p->name); + $breadcrumb[] = l($p->name, 'forum/'. $p->tid); } } } - + drupal_set_breadcrumb($breadcrumb); drupal_set_title(check_plain($title)); - $breadcrumb[] = array('path' => $_GET['q']); - menu_set_location($breadcrumb); - if ($variables['forums_defined'] = count($variables['forums']) || count($variables['parents'])) { // Format the "post new content" links listing. $forum_types = array(); -- cgit v1.2.3