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 | |
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.
30 files changed, 318 insertions, 130 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; } diff --git a/modules/archive.module b/modules/archive.module index 58a682182..be2ad00f4 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -194,6 +194,12 @@ function archive_link($type) { } } + if ($type == "system") { + if (user_access("access content")) { + menu("archive", t("archives"), "archive_page", 0, 1); + } + } + return $links; } @@ -230,7 +236,7 @@ function archive_page() { $start = "<div class=\"container-inline\">"; $start .= form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show")); $start .= "</div>"; - print theme("box", t("Archives"), form($start)); + print form($start); /* ** Fetch nodes for the selected date, or current date if none diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 58a682182..be2ad00f4 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -194,6 +194,12 @@ function archive_link($type) { } } + if ($type == "system") { + if (user_access("access content")) { + menu("archive", t("archives"), "archive_page", 0, 1); + } + } + return $links; } @@ -230,7 +236,7 @@ function archive_page() { $start = "<div class=\"container-inline\">"; $start .= form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show")); $start .= "</div>"; - print theme("box", t("Archives"), form($start)); + print form($start); /* ** Fetch nodes for the selected date, or current date if none diff --git a/modules/book.module b/modules/book.module index c431fdf47..7482bd3eb 100644 --- a/modules/book.module +++ b/modules/book.module @@ -71,7 +71,7 @@ function book_link($type, $node = 0, $main = 0) { if ($type == "system") { if (user_access("maintain books")) { - menu("node/add/book", t("book page"), "page", 0); + menu("node/add/book", t("book page"), "node_page", 0); } if (user_access("administer nodes")) { menu("admin/node/book", t("books"), "book_admin", 4); @@ -623,8 +623,9 @@ function book_render() { } } + drupal_set_title(t("Books")); print theme("header"); - print theme("box", t("Books"), "$output"); + print $output; print theme("footer"); } @@ -646,8 +647,9 @@ function book_page() { } } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/book/book.module b/modules/book/book.module index c431fdf47..7482bd3eb 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -71,7 +71,7 @@ function book_link($type, $node = 0, $main = 0) { if ($type == "system") { if (user_access("maintain books")) { - menu("node/add/book", t("book page"), "page", 0); + menu("node/add/book", t("book page"), "node_page", 0); } if (user_access("administer nodes")) { menu("admin/node/book", t("books"), "book_admin", 4); @@ -623,8 +623,9 @@ function book_render() { } } + drupal_set_title(t("Books")); print theme("header"); - print theme("box", t("Books"), "$output"); + print $output; print theme("footer"); } @@ -646,8 +647,9 @@ function book_page() { } } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/comment.module b/modules/comment.module index 7141d3da8..6b71fd388 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -883,8 +883,9 @@ function comment_page() { case t("Post comment"): list($error_title, $error_body) = comment_post($edit); if ($error_body) { + drupal_set_title($error_title); print theme("header"); - print theme("box", $error_title, $error_body); + print $error_body; print theme("footer"); } else { diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 7141d3da8..6b71fd388 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -883,8 +883,9 @@ function comment_page() { case t("Post comment"): list($error_title, $error_body) = comment_post($edit); if ($error_body) { + drupal_set_title($error_title); print theme("header"); - print theme("box", $error_title, $error_body); + print $error_body; print theme("footer"); } else { diff --git a/modules/drupal.module b/modules/drupal.module index df30832f9..ae609c132 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -162,9 +162,9 @@ function drupal_link($type) { } function drupal_page() { - + drupal_set_title("Drupal"); print theme("header"); - print theme("box", "Drupal", drupal_help("user/help#drupal")); + print drupal_help("user/help#drupal"); print theme("footer"); } diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index df30832f9..ae609c132 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -162,9 +162,9 @@ function drupal_link($type) { } function drupal_page() { - + drupal_set_title("Drupal"); print theme("header"); - print theme("box", "Drupal", drupal_help("user/help#drupal")); + print drupal_help("user/help#drupal"); print theme("footer"); } diff --git a/modules/forum.module b/modules/forum.module index c1c6093ad..542449668 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -442,16 +442,16 @@ function forum_page() { print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - $message = t("Warning"); - print theme("header", $message); - print theme("box", $message, _forum_message_taxonomy()); + drupal_set_title(t("Warning")); + print theme("header"); + print _forum_message_taxonomy(); print theme("footer"); } } else { - $message = t("Access denied"); - print theme("header", $message); - print theme("box", $message, message_access()); + drupal_set_title(t("Access denied")); + print theme("header"); + print message_access(); print theme("footer"); } } @@ -513,9 +513,10 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output = ''; } - print theme("header", $title); - print theme("breadcrumb", $breadcrumb); - print theme("box", $title, $output); + drupal_set_title($title); + drupal_set_breadcrumb($breadcrumb); + print theme("header"); + print $output; print theme("footer"); } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index c1c6093ad..542449668 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -442,16 +442,16 @@ function forum_page() { print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset); } else { - $message = t("Warning"); - print theme("header", $message); - print theme("box", $message, _forum_message_taxonomy()); + drupal_set_title(t("Warning")); + print theme("header"); + print _forum_message_taxonomy(); print theme("footer"); } } else { - $message = t("Access denied"); - print theme("header", $message); - print theme("box", $message, message_access()); + drupal_set_title(t("Access denied")); + print theme("header"); + print message_access(); print theme("footer"); } } @@ -513,9 +513,10 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output = ''; } - print theme("header", $title); - print theme("breadcrumb", $breadcrumb); - print theme("box", $title, $output); + drupal_set_title($title); + drupal_set_breadcrumb($breadcrumb); + print theme("header"); + print $output; print theme("footer"); } diff --git a/modules/node.module b/modules/node.module index f0abb2ce8..46ae6a8c3 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1505,57 +1505,84 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - print theme("header", $node->title); - $name = module_invoke(arg(2), "node", "name"); switch ($op) { case "add": - print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); + drupal_set_title(t("Submit %name", array("%name" => $name))); + print theme("header"); + print node_add(arg(2)); + print theme("footer"); break; case "edit": - print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); + drupal_set_title(t("Edit %name", array("%name" => $name))); + print theme("header"); + print node_edit(arg(2)); + print theme("footer"); break; case "view": + drupal_set_title($node->title); + print theme("header"); print node_show($node, arg(3)); + print theme("footer"); break; case "revisions": - theme("box", t("Revisions"), node_revision_overview((arg(2)))); + drupal_set_title(t("Revisions")); + print theme("header"); + print node_revision_overview(arg(2)); + print theme("footer"); break; case "rollback-revision": $output = node_revision_rollback(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); - theme("box", t("Revisions"), $output); + drupal_set_title(t("Revisions")); + print theme("header"); + print $output; + print theme("footer"); break; case "delete-revision": $output = node_revision_delete(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); - theme("box", t("Revisions"), $output); + drupal_set_title(t("Revisions")); + print theme("header"); + print $output; + print theme("footer"); break; case t("Preview"): $edit = node_validate($edit, $error); - print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); + drupal_set_title(t("Preview %name", array("%name" => $name))); + print theme("header"); + print node_preview($edit, $error); + print theme("footer"); break; case t("Submit"): - print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); + drupal_set_title(t("Submit %name", array("%name" => $name))); + print theme("header"); + print node_submit($edit); + print theme("footer"); break; case t("Delete"): - print theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit)); + drupal_set_title(t("Delete %name", array("%name" => $name))); + print theme("header"); + print node_delete($edit); + print theme("footer"); break; default: + drupal_set_title(""); + print theme("header"); $result = pager_query("SELECT nid, type FROM {node} WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10)); while ($node = db_fetch_object($result)) { node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); + print theme("footer"); } - - print theme("footer"); } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } diff --git a/modules/node/node.module b/modules/node/node.module index f0abb2ce8..46ae6a8c3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1505,57 +1505,84 @@ function node_page() { $node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]); } - print theme("header", $node->title); - $name = module_invoke(arg(2), "node", "name"); switch ($op) { case "add": - print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2))); + drupal_set_title(t("Submit %name", array("%name" => $name))); + print theme("header"); + print node_add(arg(2)); + print theme("footer"); break; case "edit": - print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2))); + drupal_set_title(t("Edit %name", array("%name" => $name))); + print theme("header"); + print node_edit(arg(2)); + print theme("footer"); break; case "view": + drupal_set_title($node->title); + print theme("header"); print node_show($node, arg(3)); + print theme("footer"); break; case "revisions": - theme("box", t("Revisions"), node_revision_overview((arg(2)))); + drupal_set_title(t("Revisions")); + print theme("header"); + print node_revision_overview(arg(2)); + print theme("footer"); break; case "rollback-revision": $output = node_revision_rollback(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); - theme("box", t("Revisions"), $output); + drupal_set_title(t("Revisions")); + print theme("header"); + print $output; + print theme("footer"); break; case "delete-revision": $output = node_revision_delete(arg(2), arg(3)); $output .= node_revision_overview(arg(2)); - theme("box", t("Revisions"), $output); + drupal_set_title(t("Revisions")); + print theme("header"); + print $output; + print theme("footer"); break; case t("Preview"): $edit = node_validate($edit, $error); - print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error)); + drupal_set_title(t("Preview %name", array("%name" => $name))); + print theme("header"); + print node_preview($edit, $error); + print theme("footer"); break; case t("Submit"): - print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit)); + drupal_set_title(t("Submit %name", array("%name" => $name))); + print theme("header"); + print node_submit($edit); + print theme("footer"); break; case t("Delete"): - print theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit)); + drupal_set_title(t("Delete %name", array("%name" => $name))); + print theme("header"); + print node_delete($edit); + print theme("footer"); break; default: + drupal_set_title(""); + print theme("header"); $result = pager_query("SELECT nid, type FROM {node} WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10)); while ($node = db_fetch_object($result)) { node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); + print theme("footer"); } - - print theme("footer"); } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } diff --git a/modules/poll.module b/modules/poll.module index 6fba8859e..fe2cd92b4 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -257,7 +257,7 @@ function poll_page() { $output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>"; } $output .= "</ul>"; - print theme("box", t("Polls"), $output); + print $output; print theme("footer"); } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 6fba8859e..fe2cd92b4 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -257,7 +257,7 @@ function poll_page() { $output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>"; } $output .= "</ul>"; - print theme("box", t("Polls"), $output); + print $output; print theme("footer"); } diff --git a/modules/queue.module b/modules/queue.module index 53fc56895..23658a180 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -116,8 +116,9 @@ function queue_overview() { } $output .= "</table>"; + drupal_set_title(t("Moderation queue")); print theme("header"); - print theme("box", t("Moderation queue"), $output); + print $output; print theme("footer"); } @@ -192,7 +193,7 @@ function queue_page() { } else { print theme("header"); - print theme("box", t("Moderation queue"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/search.module b/modules/search.module index 78bca2a88..9dedb035a 100644 --- a/modules/search.module +++ b/modules/search.module @@ -46,6 +46,10 @@ function search_link($type) { menu("search", t("search"), "search_page", 0, 1); } + if ($type == "system" && user_access("search content")) { + menu("search", t("search"), "search_page", 0, 1); + } + return $links; } @@ -361,23 +365,22 @@ function search_view($keys) { $help_link = l(t("search help"), "search/help"); switch (variable_get("help_pos", 1)) { case "1": - $form = search_help(). $form; + $form = search_help(). $form ."<br />"; break; case "2": - $form .= search_help(); + $form .= search_help() ."<br />"; break; case "3": - $form = $help_link. "<br />". $form; + $form = $help_link. "<br />". $form ."<br />"; break; case "4": - $form .= "<br />". $help_link; + $form .= "<br />". $help_link ."<br />"; } - print theme("header", t("Search")); + drupal_set_title(t("Search")); + print theme("header"); - if ($form) { - print theme("box", t("Search"), $form); - } + print $form; if ($keys) { if ($output) { @@ -391,8 +394,9 @@ function search_view($keys) { print theme("footer"); } else { - print theme("header", t("Access denied")); - print theme("box", t("Access denied"), message_access()); + drupal_set_title(t("Access denied")); + print theme("header"); + print message_access(); print theme("footer"); } @@ -403,8 +407,9 @@ function search_page() { switch (arg(1)) { case "help": + drupal_set_title(t("Search Help")); print theme("header"); - print theme("box", t("Search Help"), search_help()); + print search_help(); print theme("footer"); break; default: diff --git a/modules/search/search.module b/modules/search/search.module index 78bca2a88..9dedb035a 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -46,6 +46,10 @@ function search_link($type) { menu("search", t("search"), "search_page", 0, 1); } + if ($type == "system" && user_access("search content")) { + menu("search", t("search"), "search_page", 0, 1); + } + return $links; } @@ -361,23 +365,22 @@ function search_view($keys) { $help_link = l(t("search help"), "search/help"); switch (variable_get("help_pos", 1)) { case "1": - $form = search_help(). $form; + $form = search_help(). $form ."<br />"; break; case "2": - $form .= search_help(); + $form .= search_help() ."<br />"; break; case "3": - $form = $help_link. "<br />". $form; + $form = $help_link. "<br />". $form ."<br />"; break; case "4": - $form .= "<br />". $help_link; + $form .= "<br />". $help_link ."<br />"; } - print theme("header", t("Search")); + drupal_set_title(t("Search")); + print theme("header"); - if ($form) { - print theme("box", t("Search"), $form); - } + print $form; if ($keys) { if ($output) { @@ -391,8 +394,9 @@ function search_view($keys) { print theme("footer"); } else { - print theme("header", t("Access denied")); - print theme("box", t("Access denied"), message_access()); + drupal_set_title(t("Access denied")); + print theme("header"); + print message_access(); print theme("footer"); } @@ -403,8 +407,9 @@ function search_page() { switch (arg(1)) { case "help": + drupal_set_title(t("Search Help")); print theme("header"); - print theme("box", t("Search Help"), search_help()); + print search_help(); print theme("footer"); break; default: diff --git a/modules/statistics.module b/modules/statistics.module index 08732b32f..78284090f 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -783,8 +783,9 @@ function statistics_page() { print theme("footer"); } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 08732b32f..78284090f 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -783,8 +783,9 @@ function statistics_page() { print theme("footer"); } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/title.module b/modules/title.module index 9206f3605..8de104f93 100644 --- a/modules/title.module +++ b/modules/title.module @@ -57,14 +57,16 @@ function title_page() { $output .= theme("table", $header, $rows); $output .= "</div>"; + drupal_set_title(t("Matching Posts")); print theme("header"); - print theme("box", t("Matching Posts"), $output); + print $output; print theme("footer"); } } else { + drupal_set_title(t("Access denied")); print theme("header"); - print theme("box", t("Access denied"), message_access()); + print message_access(); print theme("footer"); } } diff --git a/modules/tracker.module b/modules/tracker.module index 3d82de563..1d06272c3 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -104,8 +104,9 @@ function tracker_page() { global $user; if (user_access("access content")) { - print theme("header", t("Recent posts")); - print theme("box", t("Recent posts"), tracker_posts(arg(1))); + drupal_set_title(t("Recent posts")); + print theme("header"); + print tracker_posts(arg(1)); print theme("footer"); } else { diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 3d82de563..1d06272c3 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -104,8 +104,9 @@ function tracker_page() { global $user; if (user_access("access content")) { - print theme("header", t("Recent posts")); - print theme("box", t("Recent posts"), tracker_posts(arg(1))); + drupal_set_title(t("Recent posts")); + print theme("header"); + print tracker_posts(arg(1)); print theme("footer"); } else { diff --git a/modules/user.module b/modules/user.module index 25cc892b9..826d14b9f 100644 --- a/modules/user.module +++ b/modules/user.module @@ -963,8 +963,9 @@ function user_view($uid = 0) { $output .= implode("\n", module_invoke_all("user", "view_private", "", $user)); - print theme("header", $user->name); - print theme("box", $user->name, $output); + drupal_set_title($user->name); + print theme("header"); + print $output; print theme("footer"); } else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) { @@ -976,13 +977,15 @@ function user_view($uid = 0) { $output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid")); } - print theme("header", $account->name); - print theme("box", $account->name, $output); + drupal_set_title($account->name); + print theme("header"); + print $output; print theme("footer"); } else { $output = user_login(); - print theme("header", t("User login")); + drupal_set_title(t("User login")); + print theme("header"); print theme("box", t("User login"), $output); if (variable_get("user_register", 1)) { print theme("box", t("Create new user account"), user_register()); @@ -1004,16 +1007,18 @@ function user_page() { switch ($op) { case t("E-mail new password"): case "password": - print theme("header", t("E-mail new password")); - print theme("box", t("E-mail new password"), user_pass($edit)); + drupal_set_title(t("E-mail new password")); + print theme("header"); + print user_pass($edit); print theme("footer"); break; case t("Create new account"): case "register": $output = user_register($edit); - print theme("header", t("Create new account")); + drupal_set_title(t("Create new account")); + print theme("header"); if (variable_get("user_register", 1)) { - print theme("box", t("Create new account"), $output); + print $output; } else { print message_access(); @@ -1023,16 +1028,18 @@ function user_page() { case t("Log in"): case "login": $output = user_login($edit); - print theme("header", t("Log in")); - print theme("box", t("Log in"), $output); + drupal_set_title(t("Log in")); + print theme("header"); + print $output; print theme("footer"); break; case t("Save user information"): case "edit": $output = user_edit($edit); $GLOBALS["theme"] = init_theme(); - print theme("header", t("Edit user information")); - print theme("box", t("Edit user information"), $output); + drupal_set_title(t("Edit user information")); + print theme("header"); + print $output; print theme("footer"); break; case "view": @@ -1043,8 +1050,9 @@ function user_page() { print user_logout(); break; case "help": + drupal_set_title(t("Distributed authentication")); print theme("header"); - print theme("box", t("Distributed authentication"), user_help("user/help#user")); + print user_help("user/help#user"); print theme("footer"); break; default: diff --git a/modules/user/user.module b/modules/user/user.module index 25cc892b9..826d14b9f 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -963,8 +963,9 @@ function user_view($uid = 0) { $output .= implode("\n", module_invoke_all("user", "view_private", "", $user)); - print theme("header", $user->name); - print theme("box", $user->name, $output); + drupal_set_title($user->name); + print theme("header"); + print $output; print theme("footer"); } else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) { @@ -976,13 +977,15 @@ function user_view($uid = 0) { $output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid")); } - print theme("header", $account->name); - print theme("box", $account->name, $output); + drupal_set_title($account->name); + print theme("header"); + print $output; print theme("footer"); } else { $output = user_login(); - print theme("header", t("User login")); + drupal_set_title(t("User login")); + print theme("header"); print theme("box", t("User login"), $output); if (variable_get("user_register", 1)) { print theme("box", t("Create new user account"), user_register()); @@ -1004,16 +1007,18 @@ function user_page() { switch ($op) { case t("E-mail new password"): case "password": - print theme("header", t("E-mail new password")); - print theme("box", t("E-mail new password"), user_pass($edit)); + drupal_set_title(t("E-mail new password")); + print theme("header"); + print user_pass($edit); print theme("footer"); break; case t("Create new account"): case "register": $output = user_register($edit); - print theme("header", t("Create new account")); + drupal_set_title(t("Create new account")); + print theme("header"); if (variable_get("user_register", 1)) { - print theme("box", t("Create new account"), $output); + print $output; } else { print message_access(); @@ -1023,16 +1028,18 @@ function user_page() { case t("Log in"): case "login": $output = user_login($edit); - print theme("header", t("Log in")); - print theme("box", t("Log in"), $output); + drupal_set_title(t("Log in")); + print theme("header"); + print $output; print theme("footer"); break; case t("Save user information"): case "edit": $output = user_edit($edit); $GLOBALS["theme"] = init_theme(); - print theme("header", t("Edit user information")); - print theme("box", t("Edit user information"), $output); + drupal_set_title(t("Edit user information")); + print theme("header"); + print $output; print theme("footer"); break; case "view": @@ -1043,8 +1050,9 @@ function user_page() { print user_logout(); break; case "help": + drupal_set_title(t("Distributed authentication")); print theme("header"); - print theme("box", t("Distributed authentication"), user_help("user/help#user")); + print user_help("user/help#user"); print theme("footer"); break; default: diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme index ae31085fb..ed6205a27 100644 --- a/themes/marvin/marvin.theme +++ b/themes/marvin/marvin.theme @@ -14,7 +14,7 @@ function marvin_help($section) { return $output; } -function marvin_header($title = "") { +function marvin_header() { $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; $output .= "<html>\n"; @@ -22,11 +22,12 @@ function marvin_header($title = "") { $output .= theme_head($main); $output .= "<title>"; - if ($title) { - $output .= $title ." - ". variable_get("site_name", "drupal"); + if (drupal_get_title()) { + $output .= drupal_get_title() ." - ". variable_get("site_name", "drupal"); } else { - $output .= variable_get("site_name", "drupal") . ($slogan = variable_get("site_slogan", "")) ? " - $slogan" : ""; + $output .= variable_get("site_name", "drupal"); + $output .= ($slogan = variable_get("site_slogan", "")) ? " - $slogan" : ""; } $output .= "</title>\n"; @@ -55,6 +56,12 @@ function marvin_header($title = "") { } $output .= " <td style=\"vertical-align: top; width: 85%;\">\n"; + $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; } diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme index 66cd24c08..b94f30869 100644 --- a/themes/unconed/unconed.theme +++ b/themes/unconed/unconed.theme @@ -14,8 +14,9 @@ function unconed_help($section) { return $output; } -function unconed_header($title = "") { +function unconed_header() { global $base_url; + $title = drupal_get_title(); $foreground = "#000000"; $background = "#ffffff"; @@ -74,6 +75,11 @@ function unconed_header($title = "") { <tr> <td valign="top" width="80%"> <?php + print theme("breadcrumb", drupal_get_breadcrumb()); + print "<h1>" . drupal_get_title() . "</h1>"; + if ($help = menu_get_active_help()) { + print "<small>$help</small><hr />"; + } } function unconed_node($node, $main = 0) { diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme index 9bf714483..6abe6fa8b 100644 --- a/themes/xtemplate/xtemplate.theme +++ b/themes/xtemplate/xtemplate.theme @@ -84,19 +84,27 @@ function xtemplate_comment($comment, $link = 0) { return $output; } -function xtemplate_header($title = "") { +function xtemplate_header() { global $xtemplate; $xtemplate->template->assign(array( - "title" => ($title ? $title." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")), + "head_title" => (drupal_get_title() ? drupal_get_title() ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")), + "body_title" => drupal_get_title(), + "site" => variable_get("site_name", "drupal"), "head" => theme_head(), "stylesheet" => variable_get("xtemplate_stylesheet", "themes/xtemplate/xtemplate.css"), "onload_attributes" => theme_onload_attribute(), "logo" => variable_get("xtemplate_logo", "<img src=\"themes/xtemplate/images/druplicon.gif\" />"), "primary_links" => variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")), - "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")) + "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate")), + "breadcrumb" => theme("breadcrumb", drupal_get_breadcrumb()) )); + if (menu_get_active_help()) { + $xtemplate->template->assign("help", menu_get_active_help()); + $xtemplate->template->parse("header.help"); + } + if (variable_get("xtemplate_search_box", 1)) { $xtemplate->template->assign(array( //"search" => search_form(), @@ -168,4 +176,4 @@ function xtemplate_footer() { return $xtemplate->template->text("footer"); } -?>
\ No newline at end of file +?> diff --git a/themes/xtemplate/xtemplate.xtmpl b/themes/xtemplate/xtemplate.xtmpl index e4ef9a552..cf4107867 100644 --- a/themes/xtemplate/xtemplate.xtmpl +++ b/themes/xtemplate/xtemplate.xtmpl @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> - <title>{title}</title> + <title>{head_title}</title> {head} <link type="text/css" rel="stylesheet" href="{stylesheet}" /> </head> @@ -43,6 +43,11 @@ <div id="message">{header_message}</div> <!-- END: message --> <div id="main"> + {breadcrumb} + <h1>{body_title}</h1> + <!-- BEGIN: help --> + <small>{help}</small><hr /> + <!-- END: help --> <!-- END: header --> <!-- BEGIN: node --> |