diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 49 | ||||
-rw-r--r-- | includes/theme.inc | 6 |
2 files changed, 55 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index 2a67db247..aaa95276c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2,6 +2,55 @@ // $Id$ /** + * Functions to get and set the title of the current page. + */ +function drupal_set_title($title = NULL) { + static $stored_title; + + if (isset($title)) { + $stored_title = $title; + } + return $stored_title; +} + +function drupal_get_title() { + $title = drupal_set_title(); + + if (!isset($title)) { + $title = menu_get_active_title(); + } + + return $title; +} + + +/** + * Functions to get and set the breadcrumb trail of the current page. The + * breadcrumb trail is represented as an array of links, starting with + * "home" and proceeding up to but not including the current page. + */ +function drupal_set_breadcrumb($breadcrumb = NULL) { + static $stored_breadcrumb; + + if (isset($breadcrumb)) { + $stored_breadcrumb = $breadcrumb; + } + return $stored_breadcrumb; +} + +function drupal_get_breadcrumb() { + $breadcrumb = drupal_set_breadcrumb(); + + if (!isset($breadcrumb)) { + $breadcrumb = menu_get_active_breadcrumb(); + array_pop($breadcrumb); + } + + return $breadcrumb; +} + + +/** * Build the alias/path array */ function drupal_get_path_map($action = "") { diff --git a/includes/theme.inc b/includes/theme.inc index 79d39b857..3e8af9546 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -40,6 +40,12 @@ function theme_header($title = "") { $output .= theme("blocks", "all"); $output .= "</td><td style=\"vertical-align: top;\">"; + $output .= theme("breadcrumb", drupal_get_breadcrumb()); + $output .= "<h1>" . drupal_get_title() . "</h1>"; + if ($help = menu_get_active_help()) { + $output .= "<small>$help</small><hr />"; + } + return $output; } |