diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-25 08:24:43 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-25 08:24:43 +0000 |
commit | 4e187261abc63432130bd3b5661b622ba095ffeb (patch) | |
tree | 9fd4b59b53cd8a3b1fb2c0e04b65c9f6eb998d71 /modules/forum/forum.module | |
parent | 9d5516644c5e6b607d01d6349a2890668a354efb (diff) | |
download | brdo-4e187261abc63432130bd3b5661b622ba095ffeb.tar.gz brdo-4e187261abc63432130bd3b5661b622ba095ffeb.tar.bz2 |
#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.
Diffstat (limited to 'modules/forum/forum.module')
-rw-r--r-- | modules/forum/forum.module | 21 |
1 files changed, 8 insertions, 13 deletions
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(); |