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. --- includes/common.inc | 6 ++++-- includes/theme.inc | 15 +-------------- 2 files changed, 5 insertions(+), 16 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 7416c17e9..097ab84c2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -176,7 +176,8 @@ function drupal_not_found() { } if ($status != MENU_FOUND) { - print theme('page', '', t('Page not found')); + drupal_set_title(t('Page not found')); + print theme('page', ''); } } @@ -195,7 +196,8 @@ function drupal_access_denied() { } if ($status != MENU_FOUND) { - print theme('page', message_access(), t('Access denied')); + drupal_set_title(t('Access denied')); + print theme('page', message_access()); } } diff --git a/includes/theme.inc b/includes/theme.inc index 09de82652..ae93fd605 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -337,23 +337,10 @@ function theme_get_styles() { * * @param $content * A string to display in the main content area of the page. - * @param $title - * The title of the page, if different from that provided by the menu system. - * @param $breadcrumb - * The breadcrumb trail for the page, if different from that provided by the - * menu system. Use menu_set_location() instead, if possible. * @return * A string containing the entire HTML page. */ -function theme_page($content, $title = NULL, $breadcrumb = NULL) { - if (isset($title)) { - drupal_set_title($title); - } - - if (isset($breadcrumb)) { - drupal_set_breadcrumb($breadcrumb); - } - +function theme_page($content) { $output = "\n"; $output .= ''; $output .= ''; -- cgit v1.2.3