diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-12-15 21:19:42 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-12-15 21:19:42 +0000 |
commit | 2b17b3a96693d74d81f212b330a5ea89c6db0c26 (patch) | |
tree | 46a3ef3aff0b2ff7c40e1b0afc617941be1a36d7 /includes | |
parent | 5628256e6979335a58e7f9f873037873f24dae27 (diff) | |
download | brdo-2b17b3a96693d74d81f212b330a5ea89c6db0c26.tar.gz brdo-2b17b3a96693d74d81f212b330a5ea89c6db0c26.tar.bz2 |
- 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.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 6 | ||||
-rw-r--r-- | includes/theme.inc | 15 |
2 files changed, 5 insertions, 16 deletions
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 = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; $output .= '<html xmlns="http://www.w3.org/1999/xhtml">'; $output .= '<head>'; |