From 2b17b3a96693d74d81f212b330a5ea89c6db0c26 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 15 Dec 2004 21:19:42 +0000 Subject: - Patch #13907 by Neil: less ways to set the page title. * Less logic in theme code. * Encourages use of the menu system. * Easier to find where a title or breadcrumb comes from in other people's code because there are less places to look. Look in menu and then grep for the appropriate set function. Looking for calls to theme_page() is hard because there are too many of them. * Very slightly more efficient. --- modules/forum/forum.module | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 39353f5ef..ef1f44e8c 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -487,7 +487,8 @@ function forum_page($tid = 0) { print theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page); } else { - print theme('page', forum_help('admin/settings/forum'), t('Warning')); + drupal_set_title(t('Warning')); + print theme('page', forum_help('admin/settings/forum')); } } @@ -501,7 +502,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p // forum list, topics list, topic browser and 'add new topic' link $vocabulary = taxonomy_get_vocabulary(variable_get('forum_nav_vocabulary', '')); - $title = $vocabulary->name; + drupal_set_title($title = $vocabulary->name); // Breadcrumb navigation: $breadcrumb = array(); @@ -554,11 +555,11 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output .= ''; } else { - $title = t('No forums defined'); + drupal_set_title(t('No forums defined')); $output = ''; } - print theme('page', $output, $title); + print theme('page', $output); } /** -- cgit v1.2.3