diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-11-23 10:41:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-11-23 10:41:04 +0000 |
commit | 26735ac5dd06c064bb816bcf264fbeb44ac3b0b7 (patch) | |
tree | 7d3e61703899588cf9a3dd61788965bdcf629266 /includes/common.inc | |
parent | e4d791fe0d5a70867448c9fd5b2d03b9d69b98a0 (diff) | |
download | brdo-26735ac5dd06c064bb816bcf264fbeb44ac3b0b7.tar.gz brdo-26735ac5dd06c064bb816bcf264fbeb44ac3b0b7.tar.bz2 |
- Committed phase 3 of JonBob's menu changes. Adds an API for modules to
define titles and breadcrumbs for their pages, and updates the theme
system to display them.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 49 |
1 files changed, 49 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 = "") { |