summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-11-25 19:26:21 +0000
committerDries Buytaert <dries@buytaert.net>2003-11-25 19:26:21 +0000
commitc0494c0a2b2d022038baeeef33ce28bd71f35be9 (patch)
tree6538160fbe5046e15534f3fad33ec0639b363759
parent2df7214a09fd2c38123d7767c29ed130b5c42052 (diff)
downloadbrdo-c0494c0a2b2d022038baeeef33ce28bd71f35be9.tar.gz
brdo-c0494c0a2b2d022038baeeef33ce28bd71f35be9.tar.bz2
- Committed phase 4 of JonBob's menu system changes.
-rw-r--r--includes/common.inc2
-rw-r--r--includes/theme.inc39
-rw-r--r--index.php3
-rw-r--r--modules/admin.module8
-rw-r--r--modules/aggregator.module12
-rw-r--r--modules/aggregator/aggregator.module12
-rw-r--r--modules/archive.module17
-rw-r--r--modules/archive/archive.module17
-rw-r--r--modules/block.module12
-rw-r--r--modules/block/block.module12
-rw-r--r--modules/blog.module53
-rw-r--r--modules/blog/blog.module53
-rw-r--r--modules/book.module61
-rw-r--r--modules/book/book.module61
-rw-r--r--modules/comment.module72
-rw-r--r--modules/comment/comment.module72
-rw-r--r--modules/drupal.module5
-rw-r--r--modules/drupal/drupal.module5
-rw-r--r--modules/forum.module36
-rw-r--r--modules/forum/forum.module36
-rw-r--r--modules/help.module8
-rw-r--r--modules/help/help.module8
-rw-r--r--modules/import.module12
-rw-r--r--modules/locale.module12
-rw-r--r--modules/locale/locale.module12
-rw-r--r--modules/node.module98
-rw-r--r--modules/node/node.module98
-rw-r--r--modules/page.module6
-rw-r--r--modules/page/page.module6
-rw-r--r--modules/path.module8
-rw-r--r--modules/path/path.module8
-rw-r--r--modules/poll.module7
-rw-r--r--modules/poll/poll.module7
-rw-r--r--modules/queue.module12
-rw-r--r--modules/search.module49
-rw-r--r--modules/search/search.module49
-rw-r--r--modules/statistics.module47
-rw-r--r--modules/statistics/statistics.module47
-rw-r--r--modules/system.module12
-rw-r--r--modules/system/system.module12
-rw-r--r--modules/taxonomy.module6
-rw-r--r--modules/taxonomy/taxonomy.module6
-rw-r--r--modules/title.module13
-rw-r--r--modules/tracker.module9
-rw-r--r--modules/tracker/tracker.module9
-rw-r--r--modules/user.module61
-rw-r--r--modules/user/user.module61
-rw-r--r--modules/watchdog.module8
-rw-r--r--modules/watchdog/watchdog.module8
-rw-r--r--themes/marvin/marvin.theme6
-rw-r--r--themes/unconed/unconed.theme8
-rw-r--r--themes/xtemplate/xtemplate.theme6
-rw-r--r--themes/xtemplate/xtemplate.xtmpl2
53 files changed, 518 insertions, 791 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 5e4fa290c..1cf0b3c61 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -10,7 +10,7 @@ function drupal_set_title($title = NULL) {
static $stored_title;
if (isset($title)) {
- $stored_title = $title;
+ $stored_title = ucfirst($title);
}
return $stored_title;
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 3e8af9546..505c727f4 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -16,17 +16,15 @@
/**
Returns the theme header.
- @param $title (optional) override the page title.
-
@return a string containing the \a header output.
**/
-function theme_header($title = "") {
+function theme_header() {
global $base_url;
$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>";
- $output .= " <title>". $title ? $title : variable_get(site_name, "drupal") ."</title>";
+ $output .= " <title>". drupal_get_title() ? drupal_get_title() : variable_get(site_name, "drupal") ."</title>";
$output .= theme_head($main);
$output .= " <style type=\"text/css\" media=\"all\">";
$output .= " @import url(misc/drupal.css);";
@@ -50,6 +48,27 @@ function theme_header($title = "") {
}
/**
+ Returns an entire Drupal page displaying the supplied content.
+ @param $content a string containing the content to display.
+
+ @return a string containing the \a page output.
+**/
+function theme_page($content, $title = NULL, $breadcrumb = NULL) {
+ if (isset($title)) {
+ drupal_set_title($title);
+ }
+ if (isset($breadcrumb)) {
+ drupal_set_breadcrumb($breadcrumb);
+ }
+
+ $output = theme("header");
+ $output .= $content;
+ $output .= theme("footer");
+
+ return $output;
+}
+
+/**
Returns themed set of links.
@param $links an array of \a links to be themed.
@@ -98,16 +117,22 @@ function theme_breadcrumb($breadcrumb) {
\li \c $node->username the username of the poster.
@param $node the \a node to be themed.
- @param $main
+ @param $main Display teaser only, as on main page?
+ @param $page Display node as standalone page (no title)?
@return a string containing the \a node output.
**/
-function theme_node($node, $main) {
+function theme_node($node, $main = 0, $page = 0) {
if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node);
}
- $output = "<h2>$node->title</h2> by ". format_name($node);
+ if ($page == 0) {
+ $output = "<h2>$node->title</h2> by ". format_name($node);
+ }
+ else {
+ $output = "by ". format_name($node);
+ }
if (count($terms)) {
$output .= " <small>(". print theme("links", $terms) .")</small><br />";
diff --git a/index.php b/index.php
index 06c23390c..76fdd98ff 100644
--- a/index.php
+++ b/index.php
@@ -13,8 +13,7 @@ if (menu_active_handler_exists()) {
menu_execute_active_handler();
}
else {
- print theme("header");
- print theme("footer");
+ print theme("page", "");
}
drupal_page_footer();
diff --git a/modules/admin.module b/modules/admin.module
index e1de707d6..b82fc2f8e 100644
--- a/modules/admin.module
+++ b/modules/admin.module
@@ -26,14 +26,10 @@ function admin_link($type) {
function admin_admin() {
if (user_access("access administration pages")) {
- print theme("header");
- print watchdog_overview("actions");
- print theme("footer");
+ print theme("page", watchdog_overview("actions"));
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/aggregator.module b/modules/aggregator.module
index a01b46653..e4a644a6c 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -76,9 +76,7 @@ function import_help($section = "admin/help#import") {
}
function import_help_page() {
- print theme("header");
- print import_help();
- print theme("footer");
+ print theme("page", import_help());
}
function import_settings() {
@@ -618,14 +616,10 @@ function import_admin() {
default:
$output .= import_view();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index a01b46653..e4a644a6c 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -76,9 +76,7 @@ function import_help($section = "admin/help#import") {
}
function import_help_page() {
- print theme("header");
- print import_help();
- print theme("footer");
+ print theme("page", import_help());
}
function import_settings() {
@@ -618,14 +616,10 @@ function import_admin() {
default:
$output .= import_view();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/archive.module b/modules/archive.module
index be2ad00f4..594e5f7b7 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -200,6 +200,12 @@ function archive_link($type) {
}
}
+ if ($type == "system") {
+ if (user_access("access content")) {
+ menu("archive", t("archives"), "archive_page", 0, 1);
+ }
+ }
+
return $links;
}
@@ -209,7 +215,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
- print theme("header");
+ $output = "";
if (user_access("access content")) {
if ($op == t("Show")) {
@@ -236,7 +242,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 form($start);
+ $output .= form($start);
/*
** Fetch nodes for the selected date, or current date if none
@@ -247,15 +253,14 @@ function archive_page() {
$result = db_query_range("SELECT nid FROM {node} WHERE status = '1' AND created > %d ORDER BY created", $date, 0, 20);
while ($nid = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $nid->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $nid->nid)), 1);
}
}
+ print theme("page", $output);
}
else {
- message_access();
+ print theme("page", message_access());
}
-
- print theme("footer");
}
function archive_settings() {
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index be2ad00f4..594e5f7b7 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -200,6 +200,12 @@ function archive_link($type) {
}
}
+ if ($type == "system") {
+ if (user_access("access content")) {
+ menu("archive", t("archives"), "archive_page", 0, 1);
+ }
+ }
+
return $links;
}
@@ -209,7 +215,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
- print theme("header");
+ $output = "";
if (user_access("access content")) {
if ($op == t("Show")) {
@@ -236,7 +242,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 form($start);
+ $output .= form($start);
/*
** Fetch nodes for the selected date, or current date if none
@@ -247,15 +253,14 @@ function archive_page() {
$result = db_query_range("SELECT nid FROM {node} WHERE status = '1' AND created > %d ORDER BY created", $date, 0, 20);
while ($nid = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $nid->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $nid->nid)), 1);
}
}
+ print theme("page", $output);
}
else {
- message_access();
+ print theme("page", message_access());
}
-
- print theme("footer");
}
function archive_settings() {
diff --git a/modules/block.module b/modules/block.module
index 1ae859566..a6ba60145 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -54,9 +54,7 @@ function block_help($section = "admin/help#block") {
}
function block_help_page() {
- print theme("header");
- print block_help();
- print theme("footer");
+ print theme("page", block_help());
}
function block_perm() {
@@ -312,14 +310,10 @@ function block_admin() {
$output .= block_admin_display();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/block/block.module b/modules/block/block.module
index 1ae859566..a6ba60145 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -54,9 +54,7 @@ function block_help($section = "admin/help#block") {
}
function block_help_page() {
- print theme("header");
- print block_help();
- print theme("footer");
+ print theme("page", block_help());
}
function block_perm() {
@@ -312,14 +310,10 @@ function block_admin() {
$output .= block_admin_display();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/blog.module b/modules/blog.module
index be73a62de..b7f3ab8c2 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -116,34 +116,36 @@ function blog_page_user($uid) {
$account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1));
// Breadcrumb navigation:
- $breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = l(t("Blogs"), "blog");
- $breadcrumb[] = t("%name's blog", array("%name" => $account->name));
- print theme("breadcrumb", $breadcrumb);
+ $breadcrumb[] = l(t("Home"), "");
+ $breadcrumb[] = t("blogs");
+
+ $title = t("%name's blog", array("%name" => $account->name));
+ $output = "";
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
- print pager_display(NULL, variable_get("default_nodes_main", 10));
- print "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ $output .= "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
+
+ print theme("page", $output, $title);
}
function blog_page_last() {
global $user;
- // Breadcrumb navigation:
- $breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = t("Blogs");
- print theme("breadcrumb", $breadcrumb);
+ $output = "";
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
- print pager_display(NULL, variable_get("default_nodes_main", 10));
- print "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>";
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ $output .= "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>";
+
+ print theme("page", $output);
}
function blog_validate(&$node) {
@@ -207,20 +209,16 @@ function blog_page() {
}
break;
default:
- print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
- print theme("footer");
}
}
else {
- print theme("header");
- print theme("box", t("Access denied"), message_access());
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -231,18 +229,19 @@ function blog_content($node) {
return $node;
}
-function blog_view($node, $main = 0) {
- if ($main == 0) {
+function blog_view($node, $main = 0, $page = 0) {
+ if ($page) {
// Breadcrumb navigation
- $breadcrumb[] = l(t("Home"), NULL);
+ $breadcrumb[] = l(t("Home"), "");
+ $breadcrumb[] = l(t("blogs"), "blog");
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
- // print the breadcrumb
- print theme("breadcrumb", $breadcrumb);
+ // set the breadcrumb
+ drupal_set_breadcrumb($breadcrumb);
}
- // prepair the node content
+ // prepare the node content
$node = blog_content($node);
// print the node
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
function blog_link($type, $node = 0, $main) {
@@ -258,7 +257,7 @@ function blog_link($type, $node = 0, $main) {
menu("blog/" . $user->uid, t("my blog"), "blog_page", 1);
}
if (user_access("access content")) {
- menu("blog", t("blog"), "blog_page", 0, 1);
+ menu("blog", t("blogs"), "blog_page", 0, 1);
}
}
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index be73a62de..b7f3ab8c2 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -116,34 +116,36 @@ function blog_page_user($uid) {
$account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1));
// Breadcrumb navigation:
- $breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = l(t("Blogs"), "blog");
- $breadcrumb[] = t("%name's blog", array("%name" => $account->name));
- print theme("breadcrumb", $breadcrumb);
+ $breadcrumb[] = l(t("Home"), "");
+ $breadcrumb[] = t("blogs");
+
+ $title = t("%name's blog", array("%name" => $account->name));
+ $output = "";
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
- print pager_display(NULL, variable_get("default_nodes_main", 10));
- print "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ $output .= "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
+
+ print theme("page", $output, $title);
}
function blog_page_last() {
global $user;
- // Breadcrumb navigation:
- $breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = t("Blogs");
- print theme("breadcrumb", $breadcrumb);
+ $output = "";
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid)), 1);
+ $output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
- print pager_display(NULL, variable_get("default_nodes_main", 10));
- print "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>";
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ $output .= "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>";
+
+ print theme("page", $output);
}
function blog_validate(&$node) {
@@ -207,20 +209,16 @@ function blog_page() {
}
break;
default:
- print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
- print theme("footer");
}
}
else {
- print theme("header");
- print theme("box", t("Access denied"), message_access());
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -231,18 +229,19 @@ function blog_content($node) {
return $node;
}
-function blog_view($node, $main = 0) {
- if ($main == 0) {
+function blog_view($node, $main = 0, $page = 0) {
+ if ($page) {
// Breadcrumb navigation
- $breadcrumb[] = l(t("Home"), NULL);
+ $breadcrumb[] = l(t("Home"), "");
+ $breadcrumb[] = l(t("blogs"), "blog");
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
- // print the breadcrumb
- print theme("breadcrumb", $breadcrumb);
+ // set the breadcrumb
+ drupal_set_breadcrumb($breadcrumb);
}
- // prepair the node content
+ // prepare the node content
$node = blog_content($node);
// print the node
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
function blog_link($type, $node = 0, $main) {
@@ -258,7 +257,7 @@ function blog_link($type, $node = 0, $main) {
menu("blog/" . $user->uid, t("my blog"), "blog_page", 1);
}
if (user_access("access content")) {
- menu("blog", t("blog"), "blog_page", 0, 1);
+ menu("blog", t("blogs"), "blog_page", 0, 1);
}
}
diff --git a/modules/book.module b/modules/book.module
index 94f123447..0f36bc357 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -383,7 +383,7 @@ function book_content($node) {
return $node;
}
-function book_view($node, $main = 0) {
+function book_view($node, $main = 0, $page = 0) {
$node = book_content($node);
/*
** Display the node. If not displayed on the main page, we render
@@ -391,30 +391,35 @@ function book_view($node, $main = 0) {
** and the next page.
*/
+ $output = "";
+
if ($main) {
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
}
else {
if ($node->moderate) {
$node->body = $node->body . "<div class=\"log\"><div class=\"title\">". t("Log") .":</div>$node->log</div>";
}
// Add the navigation and the breadcrumb if we view a page
- if (arg(1) == "view") {
+ if ($page) {
$node = book_navigation($node);
// Print the breadcrumb
- print theme("breadcrumb", $node->breadcrumb);
+ drupal_set_breadcrumb($node->breadcrumb);
}
// Print the node
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
}
+
+ return $output;
}
function book_show($node, $cid) {
+ $output = "";
if (node_access("view", $node)) {
if ($node->type == "book") {
- book_view($node, 0);
+ $output .= book_view($node, 0, 1);
}
else {
@@ -443,8 +448,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
- print theme("breadcrumb", $node->breadcrumb);
- print theme("node", $node, 0);
+ drupal_set_breadcrumb($node->breadcrumb);
+ $output .= theme("node", $node, 0, 1);
}
else {
@@ -452,11 +457,11 @@ function book_show($node, $cid) {
** We can't get the content of the node and just view the node.
** We don't add breadcrums or links.
*/
- node_view($node, 0);
+ $output .= node_view($node, 0, 1);
}
}
if (function_exists("comment_render") && $node->comment) {
- comment_render($node, $cid);
+ $output .= comment_render($node, $cid);
}
/*
@@ -464,6 +469,10 @@ function book_show($node, $cid) {
*/
node_tag_new($node->nid);
}
+ else {
+ $output .= message_access();
+ }
+ return $output;
}
function book_navigation($node) {
@@ -476,7 +485,7 @@ function book_navigation($node) {
$node->breadcrumb = ""; // Overwrite the trail with a book trail.
$node->breadcrumb[] = l(t("Home"), "");
- $node->breadcrumb[] = l(t("Books"), "book");
+ $node->breadcrumb[] = l(t("books"), "book");
foreach ($path as $level) {
$node->breadcrumb[] = l($level->title, "book/view/$level->nid");
}
@@ -625,9 +634,7 @@ function book_render() {
}
drupal_set_title(t("Books"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function book_page() {
@@ -636,9 +643,8 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
- print theme("header");
- book_show($node, arg(3));
- print theme("footer");
+ $output = book_show($node, arg(3));
+ print theme("page", $output, $node->title);
break;
case "print":
print book_print(arg(2), $depth = 1);
@@ -648,10 +654,7 @@ function book_page() {
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -805,9 +808,7 @@ function book_admin_orphan() {
$output .= theme("table", $header, $rows);
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function book_admin_links() {
@@ -839,14 +840,10 @@ function book_admin() {
$output .= book_admin_view(arg(3));
break;
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -883,8 +880,6 @@ function book_help($section = "admin/help#book") {
}
function book_help_page() {
- print theme("header");
- print book_help();
- print theme("footer");
+ print theme("page", book_help());
}
?>
diff --git a/modules/book/book.module b/modules/book/book.module
index 94f123447..0f36bc357 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -383,7 +383,7 @@ function book_content($node) {
return $node;
}
-function book_view($node, $main = 0) {
+function book_view($node, $main = 0, $page = 0) {
$node = book_content($node);
/*
** Display the node. If not displayed on the main page, we render
@@ -391,30 +391,35 @@ function book_view($node, $main = 0) {
** and the next page.
*/
+ $output = "";
+
if ($main) {
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
}
else {
if ($node->moderate) {
$node->body = $node->body . "<div class=\"log\"><div class=\"title\">". t("Log") .":</div>$node->log</div>";
}
// Add the navigation and the breadcrumb if we view a page
- if (arg(1) == "view") {
+ if ($page) {
$node = book_navigation($node);
// Print the breadcrumb
- print theme("breadcrumb", $node->breadcrumb);
+ drupal_set_breadcrumb($node->breadcrumb);
}
// Print the node
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
}
+
+ return $output;
}
function book_show($node, $cid) {
+ $output = "";
if (node_access("view", $node)) {
if ($node->type == "book") {
- book_view($node, 0);
+ $output .= book_view($node, 0, 1);
}
else {
@@ -443,8 +448,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
- print theme("breadcrumb", $node->breadcrumb);
- print theme("node", $node, 0);
+ drupal_set_breadcrumb($node->breadcrumb);
+ $output .= theme("node", $node, 0, 1);
}
else {
@@ -452,11 +457,11 @@ function book_show($node, $cid) {
** We can't get the content of the node and just view the node.
** We don't add breadcrums or links.
*/
- node_view($node, 0);
+ $output .= node_view($node, 0, 1);
}
}
if (function_exists("comment_render") && $node->comment) {
- comment_render($node, $cid);
+ $output .= comment_render($node, $cid);
}
/*
@@ -464,6 +469,10 @@ function book_show($node, $cid) {
*/
node_tag_new($node->nid);
}
+ else {
+ $output .= message_access();
+ }
+ return $output;
}
function book_navigation($node) {
@@ -476,7 +485,7 @@ function book_navigation($node) {
$node->breadcrumb = ""; // Overwrite the trail with a book trail.
$node->breadcrumb[] = l(t("Home"), "");
- $node->breadcrumb[] = l(t("Books"), "book");
+ $node->breadcrumb[] = l(t("books"), "book");
foreach ($path as $level) {
$node->breadcrumb[] = l($level->title, "book/view/$level->nid");
}
@@ -625,9 +634,7 @@ function book_render() {
}
drupal_set_title(t("Books"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function book_page() {
@@ -636,9 +643,8 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
- print theme("header");
- book_show($node, arg(3));
- print theme("footer");
+ $output = book_show($node, arg(3));
+ print theme("page", $output, $node->title);
break;
case "print":
print book_print(arg(2), $depth = 1);
@@ -648,10 +654,7 @@ function book_page() {
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -805,9 +808,7 @@ function book_admin_orphan() {
$output .= theme("table", $header, $rows);
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function book_admin_links() {
@@ -839,14 +840,10 @@ function book_admin() {
$output .= book_admin_view(arg(3));
break;
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -883,8 +880,6 @@ function book_help($section = "admin/help#book") {
}
function book_help_page() {
- print theme("header");
- print book_help();
- print theme("footer");
+ print theme("page", book_help());
}
?>
diff --git a/modules/comment.module b/modules/comment.module
index 6b71fd388..fd16e3623 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -110,9 +110,7 @@ function comment_help($section = "admin/help#comment") {
}
function comment_help_page() {
- print theme("header");
- print comment_help();
- print theme("footer");
+ print theme("page", comment_help());
}
function comment_settings() {
@@ -239,7 +237,7 @@ function comment_reply($pid, $nid) {
print theme("comment_view", $comment);
}
else if (user_access("access content")) {
- node_view(node_load(array("nid" => $nid)));
+ print node_view(node_load(array("nid" => $nid)));
$pid = 0;
}
@@ -290,7 +288,7 @@ function comment_preview($edit) {
print theme("comment_view", $comment);
}
else {
- node_view(node_load(array("nid" => $edit["nid"])));
+ print node_view(node_load(array("nid" => $edit["nid"])));
$edit["pid"] = 0;
}
}
@@ -552,6 +550,8 @@ function comment_render($node, $cid = 0) {
$comments_per_page = $_GET["comments_per_page"];
$comment_page = $_GET["comment_page"];
+ $output = "";
+
if (user_access("access comments")) {
/*
@@ -586,7 +586,7 @@ function comment_render($node, $cid = 0) {
$comments_per_page = $user->comments_per_page ? $user->comments_per_page : ($_SESSION["comment_comments_per_page"] ? $_SESSION["comment_comments_per_page"] : variable_get("comment_default_per_page", "50"));
}
- print "<a id=\"comment\"></a>\n";
+ $output .= "<a id=\"comment\"></a>\n";
if ($cid) {
@@ -595,19 +595,19 @@ function comment_render($node, $cid = 0) {
** Single comment view
*/
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print form_hidden("nid", $nid);
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= form_hidden("nid", $nid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
- print theme("comment_view",$comment, comment_links($comment));
+ $output .= theme("comment_view",$comment, comment_links($comment));
}
if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
- print "<div style=\"text-align: center;\">". form_submit(t("Moderate comment")) ."</div><br />";
+ $output .= "<div style=\"text-align: center;\">". form_submit(t("Moderate comment")) ."</div><br />";
}
- print "</div></form>";
+ $output .= "</div></form>";
}
else {
@@ -713,29 +713,29 @@ function comment_render($node, $cid = 0) {
$result = pager_query($query, $comments_per_page, 0, "SELECT COUNT(*) FROM {comments} WHERE nid = '". check_query($nid) ."'");
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
- print form_hidden("nid", $nid);
- print "</div></form>";
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
+ $output .= form_hidden("nid", $nid);
+ $output .= "</div></form>";
}
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print form_hidden("nid", $nid);
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= form_hidden("nid", $nid);
while ($comment = db_fetch_object($result)) {
$comment->depth = count(explode(".", $comment->thread)) - 1;
if ($mode == 1) {
- print theme("comment_flat_collapsed", $comment, $threshold_min);
+ $output .= theme("comment_flat_collapsed", $comment, $threshold_min);
}
else if ($mode == 2) {
- print theme("comment_flat_expanded", $comment, $threshold_min);
+ $output .= theme("comment_flat_expanded", $comment, $threshold_min);
}
else if ($mode == 3) {
- print theme("comment_thread_min", $comment, $threshold_min);
+ $output .= theme("comment_thread_min", $comment, $threshold_min);
}
else if ($mode == 4) {
- print theme("comment_thread_max", $comment, $threshold_min);
+ $output .= theme("comment_thread_max", $comment, $threshold_min);
}
}
@@ -744,20 +744,20 @@ function comment_render($node, $cid = 0) {
** is global and defined in pager.inc
*/
if ($pager = pager_display(NULL, $comments_per_page, 0, "default", array("comments_per_page" => $comments_per_page))) {
- print $pager;
+ $output .= $pager;
}
if (db_num_rows($result) && comment_user_can_moderate($node)) {
- print "<div align=\"center\">". form_submit(t("Moderate comments")) ."</div><br />";
+ $output .= "<div align=\"center\">". form_submit(t("Moderate comments")) ."</div><br />";
}
- print "</div></form>";
+ $output .= "</div></form>";
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) {
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
- print form_hidden("nid", $nid);
- print "</div></form>";
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
+ $output .= form_hidden("nid", $nid);
+ $output .= "</div></form>";
}
}
@@ -766,9 +766,10 @@ function comment_render($node, $cid = 0) {
*/
if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
- print theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
+ $output .= theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
}
}
+ return $output;
}
function comment_perm() {
@@ -883,10 +884,7 @@ 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 $error_body;
- print theme("footer");
+ print theme("page", $error_body, $error_title);
}
else {
drupal_goto(url(comment_referer_load()));
@@ -1239,14 +1237,10 @@ function comment_admin() {
$output = comment_admin_overview(0);
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 6b71fd388..fd16e3623 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -110,9 +110,7 @@ function comment_help($section = "admin/help#comment") {
}
function comment_help_page() {
- print theme("header");
- print comment_help();
- print theme("footer");
+ print theme("page", comment_help());
}
function comment_settings() {
@@ -239,7 +237,7 @@ function comment_reply($pid, $nid) {
print theme("comment_view", $comment);
}
else if (user_access("access content")) {
- node_view(node_load(array("nid" => $nid)));
+ print node_view(node_load(array("nid" => $nid)));
$pid = 0;
}
@@ -290,7 +288,7 @@ function comment_preview($edit) {
print theme("comment_view", $comment);
}
else {
- node_view(node_load(array("nid" => $edit["nid"])));
+ print node_view(node_load(array("nid" => $edit["nid"])));
$edit["pid"] = 0;
}
}
@@ -552,6 +550,8 @@ function comment_render($node, $cid = 0) {
$comments_per_page = $_GET["comments_per_page"];
$comment_page = $_GET["comment_page"];
+ $output = "";
+
if (user_access("access comments")) {
/*
@@ -586,7 +586,7 @@ function comment_render($node, $cid = 0) {
$comments_per_page = $user->comments_per_page ? $user->comments_per_page : ($_SESSION["comment_comments_per_page"] ? $_SESSION["comment_comments_per_page"] : variable_get("comment_default_per_page", "50"));
}
- print "<a id=\"comment\"></a>\n";
+ $output .= "<a id=\"comment\"></a>\n";
if ($cid) {
@@ -595,19 +595,19 @@ function comment_render($node, $cid = 0) {
** Single comment view
*/
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print form_hidden("nid", $nid);
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= form_hidden("nid", $nid);
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
- print theme("comment_view",$comment, comment_links($comment));
+ $output .= theme("comment_view",$comment, comment_links($comment));
}
if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
- print "<div style=\"text-align: center;\">". form_submit(t("Moderate comment")) ."</div><br />";
+ $output .= "<div style=\"text-align: center;\">". form_submit(t("Moderate comment")) ."</div><br />";
}
- print "</div></form>";
+ $output .= "</div></form>";
}
else {
@@ -713,29 +713,29 @@ function comment_render($node, $cid = 0) {
$result = pager_query($query, $comments_per_page, 0, "SELECT COUNT(*) FROM {comments} WHERE nid = '". check_query($nid) ."'");
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
- print form_hidden("nid", $nid);
- print "</div></form>";
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
+ $output .= form_hidden("nid", $nid);
+ $output .= "</div></form>";
}
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print form_hidden("nid", $nid);
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= form_hidden("nid", $nid);
while ($comment = db_fetch_object($result)) {
$comment->depth = count(explode(".", $comment->thread)) - 1;
if ($mode == 1) {
- print theme("comment_flat_collapsed", $comment, $threshold_min);
+ $output .= theme("comment_flat_collapsed", $comment, $threshold_min);
}
else if ($mode == 2) {
- print theme("comment_flat_expanded", $comment, $threshold_min);
+ $output .= theme("comment_flat_expanded", $comment, $threshold_min);
}
else if ($mode == 3) {
- print theme("comment_thread_min", $comment, $threshold_min);
+ $output .= theme("comment_thread_min", $comment, $threshold_min);
}
else if ($mode == 4) {
- print theme("comment_thread_max", $comment, $threshold_min);
+ $output .= theme("comment_thread_max", $comment, $threshold_min);
}
}
@@ -744,20 +744,20 @@ function comment_render($node, $cid = 0) {
** is global and defined in pager.inc
*/
if ($pager = pager_display(NULL, $comments_per_page, 0, "default", array("comments_per_page" => $comments_per_page))) {
- print $pager;
+ $output .= $pager;
}
if (db_num_rows($result) && comment_user_can_moderate($node)) {
- print "<div align=\"center\">". form_submit(t("Moderate comments")) ."</div><br />";
+ $output .= "<div align=\"center\">". form_submit(t("Moderate comments")) ."</div><br />";
}
- print "</div></form>";
+ $output .= "</div></form>";
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) {
- print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
- print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
- print form_hidden("nid", $nid);
- print "</div></form>";
+ $output .= "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
+ $output .= theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
+ $output .= form_hidden("nid", $nid);
+ $output .= "</div></form>";
}
}
@@ -766,9 +766,10 @@ function comment_render($node, $cid = 0) {
*/
if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
- print theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
+ $output .= theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
}
}
+ return $output;
}
function comment_perm() {
@@ -883,10 +884,7 @@ 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 $error_body;
- print theme("footer");
+ print theme("page", $error_body, $error_title);
}
else {
drupal_goto(url(comment_referer_load()));
@@ -1239,14 +1237,10 @@ function comment_admin() {
$output = comment_admin_overview(0);
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/drupal.module b/modules/drupal.module
index ae609c132..040f41f89 100644
--- a/modules/drupal.module
+++ b/modules/drupal.module
@@ -162,10 +162,7 @@ function drupal_link($type) {
}
function drupal_page() {
- drupal_set_title("Drupal");
- print theme("header");
- print drupal_help("user/help#drupal");
- print theme("footer");
+ print theme("page", drupal_help("user/help#drupal"), "Drupal");
}
function drupal_login($arguments) {
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index ae609c132..040f41f89 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -162,10 +162,7 @@ function drupal_link($type) {
}
function drupal_page() {
- drupal_set_title("Drupal");
- print theme("header");
- print drupal_help("user/help#drupal");
- print theme("footer");
+ print theme("page", drupal_help("user/help#drupal"), "Drupal");
}
function drupal_login($arguments) {
diff --git a/modules/forum.module b/modules/forum.module
index 542449668..dafad9341 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -140,9 +140,9 @@ function forum_content($node) {
return $node;
}
-function forum_view($node, $main = 0) {
+function forum_view($node, $main = 0, $page = 0) {
- if ($main == 0) {
+ if ($page) {
$term_data = array_shift(taxonomy_node_get_terms($node->nid));
if (!$term_data) {
// we are previewing
@@ -151,15 +151,17 @@ function forum_view($node, $main = 0) {
$voc = taxonomy_get_vocabulary($term_data->vid);
// Breadcrumb navigation
$breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = l(t("Forums"), "forum");
+ $breadcrumb[] = l(t("forums"), "forum");
$breadcrumb[] = l($term_data->name, "forum/$term_data->tid");
// print the breadcrumb
- print theme("breadcrumb", $breadcrumb);
+ drupal_set_breadcrumb($breadcrumb);
}
- // prepair the node content
+ // prepare the node content
$node = forum_content($node);
// print the node
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
+
+ return $output;
}
function forum_validate(&$node) {
@@ -442,17 +444,11 @@ function forum_page() {
print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
}
else {
- drupal_set_title(t("Warning"));
- print theme("header");
- print _forum_message_taxonomy();
- print theme("footer");
+ print theme("page", _forum_message_taxonomy(), t("Warning"));
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -479,13 +475,15 @@ function forum_page() {
function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
- $title = t("Forums");
+ $title = t("forums");
/*
** Breadcrumb navigation:
*/
$breadcrumb[] = l(t("Home"), "");
- $breadcrumb[] = l($title, "forum");
+ if ($tid) {
+ $breadcrumb[] = l($title, "forum");
+ }
if ($parents) {
$parents = array_reverse($parents);
@@ -513,11 +511,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output = '';
}
- drupal_set_title($title);
- drupal_set_breadcrumb($breadcrumb);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $title, $breadcrumb);
}
/**
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 542449668..dafad9341 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -140,9 +140,9 @@ function forum_content($node) {
return $node;
}
-function forum_view($node, $main = 0) {
+function forum_view($node, $main = 0, $page = 0) {
- if ($main == 0) {
+ if ($page) {
$term_data = array_shift(taxonomy_node_get_terms($node->nid));
if (!$term_data) {
// we are previewing
@@ -151,15 +151,17 @@ function forum_view($node, $main = 0) {
$voc = taxonomy_get_vocabulary($term_data->vid);
// Breadcrumb navigation
$breadcrumb[] = l(t("Home"), NULL);
- $breadcrumb[] = l(t("Forums"), "forum");
+ $breadcrumb[] = l(t("forums"), "forum");
$breadcrumb[] = l($term_data->name, "forum/$term_data->tid");
// print the breadcrumb
- print theme("breadcrumb", $breadcrumb);
+ drupal_set_breadcrumb($breadcrumb);
}
- // prepair the node content
+ // prepare the node content
$node = forum_content($node);
// print the node
- print theme("node", $node, $main);
+ $output .= theme("node", $node, $main, $page);
+
+ return $output;
}
function forum_validate(&$node) {
@@ -442,17 +444,11 @@ function forum_page() {
print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
}
else {
- drupal_set_title(t("Warning"));
- print theme("header");
- print _forum_message_taxonomy();
- print theme("footer");
+ print theme("page", _forum_message_taxonomy(), t("Warning"));
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -479,13 +475,15 @@ function forum_page() {
function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
- $title = t("Forums");
+ $title = t("forums");
/*
** Breadcrumb navigation:
*/
$breadcrumb[] = l(t("Home"), "");
- $breadcrumb[] = l($title, "forum");
+ if ($tid) {
+ $breadcrumb[] = l($title, "forum");
+ }
if ($parents) {
$parents = array_reverse($parents);
@@ -513,11 +511,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output = '';
}
- drupal_set_title($title);
- drupal_set_breadcrumb($breadcrumb);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $title, $breadcrumb);
}
/**
diff --git a/modules/help.module b/modules/help.module
index f53853e4f..d8a11cfeb 100644
--- a/modules/help.module
+++ b/modules/help.module
@@ -28,9 +28,7 @@ function help_glossary() {
$output .= "</dl>";
$output = t($output, array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help")));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function help_help($section = "admin/help#help") {
@@ -62,9 +60,7 @@ function help_help($section = "admin/help#help") {
}
function help_help_page() {
- print theme("header");
- print help_help();
- print theme("footer");
+ print theme("page", help_help());
}
?>
diff --git a/modules/help/help.module b/modules/help/help.module
index f53853e4f..d8a11cfeb 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -28,9 +28,7 @@ function help_glossary() {
$output .= "</dl>";
$output = t($output, array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help")));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function help_help($section = "admin/help#help") {
@@ -62,9 +60,7 @@ function help_help($section = "admin/help#help") {
}
function help_help_page() {
- print theme("header");
- print help_help();
- print theme("footer");
+ print theme("page", help_help());
}
?>
diff --git a/modules/import.module b/modules/import.module
index a01b46653..e4a644a6c 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -76,9 +76,7 @@ function import_help($section = "admin/help#import") {
}
function import_help_page() {
- print theme("header");
- print import_help();
- print theme("footer");
+ print theme("page", import_help());
}
function import_settings() {
@@ -618,14 +616,10 @@ function import_admin() {
default:
$output .= import_view();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/locale.module b/modules/locale.module
index 8e54b97a4..79da2f23c 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -55,9 +55,7 @@ function locale_help($section = "admin/help#locale") {
}
function locale_help_page() {
- print theme("header");
- print locale_help();
- print theme("footer");
+ print theme("page", locale_help());
}
function locale_perm() {
@@ -300,14 +298,10 @@ function locale_admin() {
$output = locale_seek();
$output .= locale_seek_form();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 8e54b97a4..79da2f23c 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -55,9 +55,7 @@ function locale_help($section = "admin/help#locale") {
}
function locale_help_page() {
- print theme("header");
- print locale_help();
- print theme("footer");
+ print theme("page", locale_help());
}
function locale_perm() {
@@ -300,14 +298,10 @@ function locale_admin() {
$output = locale_seek();
$output .= locale_seek_form();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/node.module b/modules/node.module
index 46ae6a8c3..1423fe2be 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -64,9 +64,7 @@ function node_help($section = "admin/help#node") {
}
function node_help_page() {
- print theme("header");
- print node_help();
- print theme("footer");
+ print theme("page", node_help());
}
@@ -386,7 +384,7 @@ function node_save($node) {
}
-function node_view($node, $main = 0) {
+function node_view($node, $main = 0, $page = 0) {
$node = array2object($node);
@@ -403,7 +401,7 @@ function node_view($node, $main = 0) {
*/
if (module_hook($node->type, "view")) {
- node_invoke($node, "view", $main);
+ return node_invoke($node, "view", $main, $page);
}
else {
@@ -414,7 +412,7 @@ function node_view($node, $main = 0) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
}
@@ -422,10 +420,10 @@ function node_show($node, $cid) {
if (node_access("view", $node)) {
- node_view($node);
+ $output = node_view($node, 0, 1);
if (function_exists("comment_render") && $node->comment) {
- comment_render($node, $cid);
+ $output .= comment_render($node, $cid);
}
/*
@@ -433,6 +431,8 @@ function node_show($node, $cid) {
*/
node_tag_new($node->nid);
+
+ return $output;
}
}
@@ -931,14 +931,10 @@ function node_admin() {
default:
$output = node_admin_nodes();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -1348,17 +1344,18 @@ function node_preview($node, $error = NULL) {
*/
if ($view->teaser && $view->teaser != $view->body) {
- print "<h3>". t("Preview trimmed version") ."</h3>";
- node_view($view, 1);
- print "<p><i>". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
- print "<h3>". t("Preview full version") ."</h3>";
- node_view($view, 0);
+ $output = "<h3>". t("Preview trimmed version") ."</h3>";
+ $output .= node_view($view, 1);
+ $output .= "<p><i>". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
+ $output .= "<h3>". t("Preview full version") ."</h3>";
+ $output .= node_view($view, 0);
}
else {
- node_view($view, 0);
+ $output .= node_view($view, 0);
}
- return node_form($node, $error);
+ $output .= node_form($node, $error);
+ return $output;
}
}
@@ -1509,81 +1506,50 @@ function node_page() {
switch ($op) {
case "add":
- drupal_set_title(t("Submit %name", array("%name" => $name)));
- print theme("header");
- print node_add(arg(2));
- print theme("footer");
+ print theme("page", node_add(arg(2)), t("Submit %name", array("%name" => $name)));
break;
case "edit":
- drupal_set_title(t("Edit %name", array("%name" => $name)));
- print theme("header");
- print node_edit(arg(2));
- print theme("footer");
+ print theme("page", node_edit(arg(2)), t("Edit %name", array("%name" => $name)));
break;
case "view":
- drupal_set_title($node->title);
- print theme("header");
- print node_show($node, arg(3));
- print theme("footer");
+ print theme("page", node_show($node, arg(3)), $node->title);
break;
case "revisions":
- drupal_set_title(t("Revisions"));
- print theme("header");
- print node_revision_overview(arg(2));
- print theme("footer");
+ print theme("page", node_revision_overview(arg(2)), t("Revisions"));
break;
case "rollback-revision":
$output = node_revision_rollback(arg(2), arg(3));
$output .= node_revision_overview(arg(2));
- drupal_set_title(t("Revisions"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Revisions"));
break;
case "delete-revision":
$output = node_revision_delete(arg(2), arg(3));
$output .= node_revision_overview(arg(2));
- drupal_set_title(t("Revisions"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Revisions"));
break;
case t("Preview"):
$edit = node_validate($edit, $error);
- drupal_set_title(t("Preview %name", array("%name" => $name)));
- print theme("header");
- print node_preview($edit, $error);
- print theme("footer");
+ print theme("page", node_preview($edit, $error), t("Preview %name", array("%name" => $name)));
break;
case t("Submit"):
- drupal_set_title(t("Submit %name", array("%name" => $name)));
- print theme("header");
- print node_submit($edit);
- print theme("footer");
+ print theme("page", node_submit($edit), t("Submit %name", array("%name" => $name)));
break;
case t("Delete"):
- drupal_set_title(t("Delete %name", array("%name" => $name)));
- print theme("header");
- print node_delete($edit);
- print theme("footer");
+ print theme("page", node_delete($edit), t("Delete %name", array("%name" => $name)));
break;
default:
- drupal_set_title("");
- print theme("header");
+ $output = "";
$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);
+ $output .= 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");
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ print theme("page", $output, "");
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/node/node.module b/modules/node/node.module
index 46ae6a8c3..1423fe2be 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -64,9 +64,7 @@ function node_help($section = "admin/help#node") {
}
function node_help_page() {
- print theme("header");
- print node_help();
- print theme("footer");
+ print theme("page", node_help());
}
@@ -386,7 +384,7 @@ function node_save($node) {
}
-function node_view($node, $main = 0) {
+function node_view($node, $main = 0, $page = 0) {
$node = array2object($node);
@@ -403,7 +401,7 @@ function node_view($node, $main = 0) {
*/
if (module_hook($node->type, "view")) {
- node_invoke($node, "view", $main);
+ return node_invoke($node, "view", $main, $page);
}
else {
@@ -414,7 +412,7 @@ function node_view($node, $main = 0) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
}
@@ -422,10 +420,10 @@ function node_show($node, $cid) {
if (node_access("view", $node)) {
- node_view($node);
+ $output = node_view($node, 0, 1);
if (function_exists("comment_render") && $node->comment) {
- comment_render($node, $cid);
+ $output .= comment_render($node, $cid);
}
/*
@@ -433,6 +431,8 @@ function node_show($node, $cid) {
*/
node_tag_new($node->nid);
+
+ return $output;
}
}
@@ -931,14 +931,10 @@ function node_admin() {
default:
$output = node_admin_nodes();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -1348,17 +1344,18 @@ function node_preview($node, $error = NULL) {
*/
if ($view->teaser && $view->teaser != $view->body) {
- print "<h3>". t("Preview trimmed version") ."</h3>";
- node_view($view, 1);
- print "<p><i>". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
- print "<h3>". t("Preview full version") ."</h3>";
- node_view($view, 0);
+ $output = "<h3>". t("Preview trimmed version") ."</h3>";
+ $output .= node_view($view, 1);
+ $output .= "<p><i>". t("The trimmed version of your post shows how your post looks like when promoted to the main page or when exported for syndication. You can insert a delimiter '&lt;!--break--&gt' (without the quotes) to fine-tune where your post gets split.") ."</i></p>";
+ $output .= "<h3>". t("Preview full version") ."</h3>";
+ $output .= node_view($view, 0);
}
else {
- node_view($view, 0);
+ $output .= node_view($view, 0);
}
- return node_form($node, $error);
+ $output .= node_form($node, $error);
+ return $output;
}
}
@@ -1509,81 +1506,50 @@ function node_page() {
switch ($op) {
case "add":
- drupal_set_title(t("Submit %name", array("%name" => $name)));
- print theme("header");
- print node_add(arg(2));
- print theme("footer");
+ print theme("page", node_add(arg(2)), t("Submit %name", array("%name" => $name)));
break;
case "edit":
- drupal_set_title(t("Edit %name", array("%name" => $name)));
- print theme("header");
- print node_edit(arg(2));
- print theme("footer");
+ print theme("page", node_edit(arg(2)), t("Edit %name", array("%name" => $name)));
break;
case "view":
- drupal_set_title($node->title);
- print theme("header");
- print node_show($node, arg(3));
- print theme("footer");
+ print theme("page", node_show($node, arg(3)), $node->title);
break;
case "revisions":
- drupal_set_title(t("Revisions"));
- print theme("header");
- print node_revision_overview(arg(2));
- print theme("footer");
+ print theme("page", node_revision_overview(arg(2)), t("Revisions"));
break;
case "rollback-revision":
$output = node_revision_rollback(arg(2), arg(3));
$output .= node_revision_overview(arg(2));
- drupal_set_title(t("Revisions"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Revisions"));
break;
case "delete-revision":
$output = node_revision_delete(arg(2), arg(3));
$output .= node_revision_overview(arg(2));
- drupal_set_title(t("Revisions"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Revisions"));
break;
case t("Preview"):
$edit = node_validate($edit, $error);
- drupal_set_title(t("Preview %name", array("%name" => $name)));
- print theme("header");
- print node_preview($edit, $error);
- print theme("footer");
+ print theme("page", node_preview($edit, $error), t("Preview %name", array("%name" => $name)));
break;
case t("Submit"):
- drupal_set_title(t("Submit %name", array("%name" => $name)));
- print theme("header");
- print node_submit($edit);
- print theme("footer");
+ print theme("page", node_submit($edit), t("Submit %name", array("%name" => $name)));
break;
case t("Delete"):
- drupal_set_title(t("Delete %name", array("%name" => $name)));
- print theme("header");
- print node_delete($edit);
- print theme("footer");
+ print theme("page", node_delete($edit), t("Delete %name", array("%name" => $name)));
break;
default:
- drupal_set_title("");
- print theme("header");
+ $output = "";
$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);
+ $output .= 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");
+ $output .= pager_display(NULL, variable_get("default_nodes_main", 10));
+ print theme("page", $output, "");
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/page.module b/modules/page.module
index 5b5629136..75c4144d2 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -117,11 +117,11 @@ function page_content($node) {
return $node;
}
-function page_view($node, $main) {
- // prepair the node content
+function page_view($node, $main = 0, $page = 0) {
+ // prepare the node content
$node = page_content($node);
// print the node
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
function page_form(&$node, &$help, &$error) {
diff --git a/modules/page/page.module b/modules/page/page.module
index 5b5629136..75c4144d2 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -117,11 +117,11 @@ function page_content($node) {
return $node;
}
-function page_view($node, $main) {
- // prepair the node content
+function page_view($node, $main = 0, $page = 0) {
+ // prepare the node content
$node = page_content($node);
// print the node
- print theme("node", $node, $main);
+ return theme("node", $node, $main, $page);
}
function page_form(&$node, &$help, &$error) {
diff --git a/modules/path.module b/modules/path.module
index 1d66bd366..af4efe461 100644
--- a/modules/path.module
+++ b/modules/path.module
@@ -38,14 +38,10 @@ function path_admin() {
$output .= path_overview();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/path/path.module b/modules/path/path.module
index 1d66bd366..af4efe461 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -38,14 +38,10 @@ function path_admin() {
$output .= path_overview();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/poll.module b/modules/poll.module
index fe2cd92b4..b03db0c75 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -249,16 +249,13 @@ function poll_node($field) {
}
function poll_page() {
-
- print theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER JOIN {poll_choices} c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
while ($node = db_fetch_object($result)) {
$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 $output;
- print theme("footer");
+ print theme("page", $output);
}
function poll_perm() {
@@ -386,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
// We also use poll_view() for the side-block
if (!$block) {
- print theme("node", $node, $main);
+ return theme("node", $node, $main);
}
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index fe2cd92b4..b03db0c75 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -249,16 +249,13 @@ function poll_node($field) {
}
function poll_page() {
-
- print theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER JOIN {poll_choices} c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
while ($node = db_fetch_object($result)) {
$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 $output;
- print theme("footer");
+ print theme("page", $output);
}
function poll_perm() {
@@ -386,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
// We also use poll_view() for the side-block
if (!$block) {
- print theme("node", $node, $main);
+ return theme("node", $node, $main);
}
}
diff --git a/modules/queue.module b/modules/queue.module
index bb8efb2be..7c118c046 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -117,9 +117,7 @@ function queue_overview() {
$output .= "</table>";
drupal_set_title(t("Submission queue"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function queue_view($nid) {
@@ -170,12 +168,12 @@ function queue_view($nid) {
}
print theme("header");
- node_view($node);
+ print node_view($node);
if ($output) {
print theme("box", t("Moderate"), $output);
}
if ($node->comment && variable_get("queue_show_comments", 1)) {
- module_invoke("comment", "render", $node);
+ print module_invoke("comment", "render", $node);
}
print theme("footer");
}
@@ -192,9 +190,7 @@ function queue_page() {
}
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/search.module b/modules/search.module
index 3d4d191da..43c016156 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -50,6 +50,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;
}
@@ -75,15 +79,11 @@ function search_admin() {
$output = t("index invalidated") ."<br />\n";
search_cron();
$output .= t("index recreated") ."<br /><hr />\n";
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -353,48 +353,40 @@ function search_view($keys) {
if (user_access("search content")) {
// Construct the search form:
- $form = search_form(NULL, $keys, TRUE);
-
- // Collect the search results:
- $output = search_data($keys);
+ $output = search_form(NULL, $keys, TRUE);
// Display form and search results:
$help_link = l(t("search help"), "search/help");
switch (variable_get("help_pos", 1)) {
case "1":
- $form = search_help(). $form ."<br />";
+ $output = search_help(). $output ."<br />";
break;
case "2":
- $form .= search_help() ."<br />";
+ $output .= search_help() ."<br />";
break;
case "3":
- $form = $help_link. "<br />". $form ."<br />";
+ $output = $help_link. "<br />". $output ."<br />";
break;
case "4":
- $form .= "<br />". $help_link ."<br />";
+ $output .= "<br />". $help_link ."<br />";
}
- drupal_set_title(t("Search"));
- print theme("header");
-
- print $form;
+ // Collect the search results:
+ $results = search_data($keys);
if ($keys) {
- if ($output) {
- print theme("box", t("Search Results"), $output);
+ if ($results) {
+ $output .= theme("box", t("Search Results"), $results);
}
else {
- print theme("box", t("Search Results"), t("Your search yielded no results."));
+ $output .= theme("box", t("Search Results"), t("Your search yielded no results."));
}
}
- print theme("footer");
+ print theme("page", $output, t("Search"));
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -404,10 +396,7 @@ function search_page() {
switch (arg(1)) {
case "help":
- drupal_set_title(t("Search Help"));
- print theme("header");
- print search_help();
- print theme("footer");
+ print theme("page", search_help(), t("Search Help"));
break;
default:
search_view($keys);
diff --git a/modules/search/search.module b/modules/search/search.module
index 3d4d191da..43c016156 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -50,6 +50,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;
}
@@ -75,15 +79,11 @@ function search_admin() {
$output = t("index invalidated") ."<br />\n";
search_cron();
$output .= t("index recreated") ."<br /><hr />\n";
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -353,48 +353,40 @@ function search_view($keys) {
if (user_access("search content")) {
// Construct the search form:
- $form = search_form(NULL, $keys, TRUE);
-
- // Collect the search results:
- $output = search_data($keys);
+ $output = search_form(NULL, $keys, TRUE);
// Display form and search results:
$help_link = l(t("search help"), "search/help");
switch (variable_get("help_pos", 1)) {
case "1":
- $form = search_help(). $form ."<br />";
+ $output = search_help(). $output ."<br />";
break;
case "2":
- $form .= search_help() ."<br />";
+ $output .= search_help() ."<br />";
break;
case "3":
- $form = $help_link. "<br />". $form ."<br />";
+ $output = $help_link. "<br />". $output ."<br />";
break;
case "4":
- $form .= "<br />". $help_link ."<br />";
+ $output .= "<br />". $help_link ."<br />";
}
- drupal_set_title(t("Search"));
- print theme("header");
-
- print $form;
+ // Collect the search results:
+ $results = search_data($keys);
if ($keys) {
- if ($output) {
- print theme("box", t("Search Results"), $output);
+ if ($results) {
+ $output .= theme("box", t("Search Results"), $results);
}
else {
- print theme("box", t("Search Results"), t("Your search yielded no results."));
+ $output .= theme("box", t("Search Results"), t("Your search yielded no results."));
}
}
- print theme("footer");
+ print theme("page", $output, t("Search"));
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -404,10 +396,7 @@ function search_page() {
switch (arg(1)) {
case "help":
- drupal_set_title(t("Search Help"));
- print theme("header");
- print search_help();
- print theme("footer");
+ print theme("page", search_help(), t("Search Help"));
break;
default:
search_view($keys);
diff --git a/modules/statistics.module b/modules/statistics.module
index 78284090f..6889adeae 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -245,9 +245,7 @@ function statistics_help($section = "admin/help#statistics") {
}
function statistics_help_page() {
- print theme("header");
- print statistics_help();
- print theme("footer");
+ print theme("page", statistics_help());
}
@@ -325,14 +323,10 @@ function statistics_admin() {
$output .= statistics_admin_topnodes();
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -778,15 +772,10 @@ function statistics_page() {
if (user_access("access content")) {
- print theme("header");
- statistics_page_user();
- print theme("footer");
+ print theme("page", statistics_page_user());
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -799,29 +788,31 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
}
if ($displaycount = variable_get("statistics_userpage_day_cnt", 10)) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("daycount", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("daycount", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_day_head", "")), $table, "main");
}
if ($displaycount = variable_get("statistics_userpage_all_cnt", "10")) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("totalcount", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("totalcount", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_all_head", "")), $table, "main");
}
if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("timestamp", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("timestamp", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_last_head", "")), $table, "main");
}
+
+ return $output;
}
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 78284090f..6889adeae 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -245,9 +245,7 @@ function statistics_help($section = "admin/help#statistics") {
}
function statistics_help_page() {
- print theme("header");
- print statistics_help();
- print theme("footer");
+ print theme("page", statistics_help());
}
@@ -325,14 +323,10 @@ function statistics_admin() {
$output .= statistics_admin_topnodes();
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -778,15 +772,10 @@ function statistics_page() {
if (user_access("access content")) {
- print theme("header");
- statistics_page_user();
- print theme("footer");
+ print theme("page", statistics_page_user());
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
@@ -799,29 +788,31 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
}
if ($displaycount = variable_get("statistics_userpage_day_cnt", 10)) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("daycount", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("daycount", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_day_head", "")), $table, "main");
}
if ($displaycount = variable_get("statistics_userpage_all_cnt", "10")) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("totalcount", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("totalcount", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_all_head", "")), $table, "main");
}
if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) {
- $output = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
- $output .= statistics_summary("timestamp", $displaycount);
- $output .= "</table>";
+ $table = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\" style=\"width: 100%;\">";
+ $table .= statistics_summary("timestamp", $displaycount);
+ $table .= "</table>";
- print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
+ $output .= theme("box", t(variable_get("statistics_userpage_last_head", "")), $table, "main");
}
+
+ return $output;
}
diff --git a/modules/system.module b/modules/system.module
index f32f4a2ce..38c858c99 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -47,9 +47,7 @@ function system_help($section = "admin/help#system") {
}
function system_help_page() {
- print theme("header");
- print system_help();
- print theme("footer");
+ print theme("page", system_help());
}
function system_perm() {
@@ -358,14 +356,10 @@ function system_admin() {
}
$output .= system_view(arg(2), arg(3));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/system/system.module b/modules/system/system.module
index f32f4a2ce..38c858c99 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -47,9 +47,7 @@ function system_help($section = "admin/help#system") {
}
function system_help_page() {
- print theme("header");
- print system_help();
- print theme("footer");
+ print theme("page", system_help());
}
function system_perm() {
@@ -358,14 +356,10 @@ function system_admin() {
}
$output .= system_view(arg(2), arg(3));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index ca59cae25..f56b55ac1 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -686,7 +686,7 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
function taxonomy_render_nodes($result) {
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1);
+ print node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1);
}
print pager_display(NULL, variable_get("default_nodes_main", 10), 0);
}
@@ -795,9 +795,7 @@ function taxonomy_admin() {
$output .= message_access();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function taxonomy_help($section = "admin/help#taxonomy") {
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index ca59cae25..f56b55ac1 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -686,7 +686,7 @@ function taxonomy_select_nodes($taxonomy, $pager = 1) {
function taxonomy_render_nodes($result) {
while ($node = db_fetch_object($result)) {
- node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1);
+ print node_view(node_load(array("nid" => $node->nid, "type" => $node->type)), 1);
}
print pager_display(NULL, variable_get("default_nodes_main", 10), 0);
}
@@ -795,9 +795,7 @@ function taxonomy_admin() {
$output .= message_access();
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
function taxonomy_help($section = "admin/help#taxonomy") {
diff --git a/modules/title.module b/modules/title.module
index 8de104f93..aa99aefdd 100644
--- a/modules/title.module
+++ b/modules/title.module
@@ -40,9 +40,7 @@ function title_page() {
else if (db_num_rows($result) == 1) {
$node = db_fetch_object($result);
$node = node_load(array("nid" => $node->nid));
- print theme("header");
- print node_show($node, NULL);
- print theme("footer");
+ print theme("page", node_show($node, NULL));
}
else {
$header = array(t("Type"), t("Title"), t("Author"));
@@ -58,16 +56,11 @@ function title_page() {
$output .= "</div>";
drupal_set_title(t("Matching Posts"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
}
else {
- drupal_set_title(t("Access denied"));
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/tracker.module b/modules/tracker.module
index 1d06272c3..b75096f8d 100644
--- a/modules/tracker.module
+++ b/modules/tracker.module
@@ -104,15 +104,10 @@ function tracker_page() {
global $user;
if (user_access("access content")) {
- drupal_set_title(t("Recent posts"));
- print theme("header");
- print tracker_posts(arg(1));
- print theme("footer");
+ print theme("page", tracker_posts(arg(1)), t("Recent posts"));
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index 1d06272c3..b75096f8d 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -104,15 +104,10 @@ function tracker_page() {
global $user;
if (user_access("access content")) {
- drupal_set_title(t("Recent posts"));
- print theme("header");
- print tracker_posts(arg(1));
- print theme("footer");
+ print theme("page", tracker_posts(arg(1)), t("Recent posts"));
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/user.module b/modules/user.module
index 5744621c5..f983073ac 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -963,10 +963,7 @@ function user_view($uid = 0) {
$output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
- drupal_set_title($user->name);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $user->name);
}
else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
$output = form_item(t("Name"), $account->name);
@@ -977,21 +974,16 @@ function user_view($uid = 0) {
$output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
- drupal_set_title($account->name);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $account->name);
}
else {
- $output = user_login();
- drupal_set_title(t("User login"));
- print theme("header");
- print theme("box", t("User login"), $output);
+ $output = theme("box", t("User login"), user_login());
if (variable_get("user_register", 1)) {
- print theme("box", t("Create new user account"), user_register());
+ $output .= theme("box", t("Create new user account"), user_register());
}
- print theme("box", t("Request new password"), user_pass());
- print theme("footer");
+ $output .= theme("box", t("Request new password"), user_pass());
+
+ print theme("page", $output, t("User login"));
}
}
@@ -1007,40 +999,28 @@ function user_page() {
switch ($op) {
case t("E-mail new password"):
case "password":
- drupal_set_title(t("E-mail new password"));
- print theme("header");
- print user_pass($edit);
- print theme("footer");
+ print theme("page", user_pass($edit), t("E-mail new password"));
break;
case t("Create new account"):
case "register":
$output = user_register($edit);
- drupal_set_title(t("Create new account"));
- print theme("header");
if (variable_get("user_register", 1)) {
- print $output;
+ print theme("page", $output, t("Create new account"));
}
else {
- print message_access();
+ print theme("page", message_access());
}
- print theme("footer");
break;
case t("Log in"):
case "login":
$output = user_login($edit);
- drupal_set_title(t("Log in"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Log in"));
break;
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$GLOBALS["theme"] = init_theme();
- drupal_set_title(t("Edit account"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Edit account"));
break;
case "view":
user_view(arg(2));
@@ -1050,10 +1030,7 @@ function user_page() {
print user_logout();
break;
case "help":
- drupal_set_title(t("Distributed authentication"));
- print theme("header");
- print user_help("user/help#user");
- print theme("footer");
+ print theme("page", user_help("user/help#user"), t("Distributed authentication"));
break;
default:
print user_view();
@@ -1524,14 +1501,10 @@ function user_admin() {
$output = user_admin_account();
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
// the following functions comprise help for admins and developers
@@ -1753,9 +1726,7 @@ function julia_user(\$type, \$edit, &\$user) {
}
function user_help_page() {
- print theme("header");
- print user_help();
- print theme("footer");
+ print theme("page", user_help());
}
?>
diff --git a/modules/user/user.module b/modules/user/user.module
index 5744621c5..f983073ac 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -963,10 +963,7 @@ function user_view($uid = 0) {
$output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
- drupal_set_title($user->name);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $user->name);
}
else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
$output = form_item(t("Name"), $account->name);
@@ -977,21 +974,16 @@ function user_view($uid = 0) {
$output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
- drupal_set_title($account->name);
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, $account->name);
}
else {
- $output = user_login();
- drupal_set_title(t("User login"));
- print theme("header");
- print theme("box", t("User login"), $output);
+ $output = theme("box", t("User login"), user_login());
if (variable_get("user_register", 1)) {
- print theme("box", t("Create new user account"), user_register());
+ $output .= theme("box", t("Create new user account"), user_register());
}
- print theme("box", t("Request new password"), user_pass());
- print theme("footer");
+ $output .= theme("box", t("Request new password"), user_pass());
+
+ print theme("page", $output, t("User login"));
}
}
@@ -1007,40 +999,28 @@ function user_page() {
switch ($op) {
case t("E-mail new password"):
case "password":
- drupal_set_title(t("E-mail new password"));
- print theme("header");
- print user_pass($edit);
- print theme("footer");
+ print theme("page", user_pass($edit), t("E-mail new password"));
break;
case t("Create new account"):
case "register":
$output = user_register($edit);
- drupal_set_title(t("Create new account"));
- print theme("header");
if (variable_get("user_register", 1)) {
- print $output;
+ print theme("page", $output, t("Create new account"));
}
else {
- print message_access();
+ print theme("page", message_access());
}
- print theme("footer");
break;
case t("Log in"):
case "login":
$output = user_login($edit);
- drupal_set_title(t("Log in"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Log in"));
break;
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$GLOBALS["theme"] = init_theme();
- drupal_set_title(t("Edit account"));
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output, t("Edit account"));
break;
case "view":
user_view(arg(2));
@@ -1050,10 +1030,7 @@ function user_page() {
print user_logout();
break;
case "help":
- drupal_set_title(t("Distributed authentication"));
- print theme("header");
- print user_help("user/help#user");
- print theme("footer");
+ print theme("page", user_help("user/help#user"), t("Distributed authentication"));
break;
default:
print user_view();
@@ -1524,14 +1501,10 @@ function user_admin() {
$output = user_admin_account();
}
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
// the following functions comprise help for admins and developers
@@ -1753,9 +1726,7 @@ function julia_user(\$type, \$edit, &\$user) {
}
function user_help_page() {
- print theme("header");
- print user_help();
- print theme("footer");
+ print theme("page", user_help());
}
?>
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 5981f58d7..d765d2fc8 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -139,14 +139,10 @@ function watchdog_admin() {
default:
$output = watchdog_overview(arg(2));
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index 5981f58d7..d765d2fc8 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -139,14 +139,10 @@ function watchdog_admin() {
default:
$output = watchdog_overview(arg(2));
}
- print theme("header");
- print $output;
- print theme("footer");
+ print theme("page", $output);
}
else {
- print theme("header");
- print message_access();
- print theme("footer");
+ print theme("page", message_access());
}
}
diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
index ed6205a27..5c92a6970 100644
--- a/themes/marvin/marvin.theme
+++ b/themes/marvin/marvin.theme
@@ -65,7 +65,7 @@ function marvin_header() {
return $output;
}
-function marvin_node($node, $main = 0) {
+function marvin_node($node, $main = 0, $page = 0) {
if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node);
@@ -77,7 +77,9 @@ function marvin_node($node, $main = 0) {
$path = path_to_theme();
$output = "\n<!-- node: \"$node->title\" -->\n";
$output .= "<table cellpadding=\"0\" cellspacing=\"0\" style=\"border 0px; width: 100%;\">\n";
- $output .= " <tr><td$colspan><img src=\"$path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n";
+ if ($page == 0) {
+ $output .= " <tr><td$colspan><img src=\"$path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n";
+ }
$output .= " <tr style=\"vertical-align: bottom;\"><td colspan=\"2\" style=\"background-color: #000000; width: 100%;\"><img src=\"$path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" /></td></tr>\n";
$output .= " <tr><td><div style=\"color: #7c7c7c;\"><small>". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) ."</small></div></td>";
if ($colspan) {
diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme
index b94f30869..cee33d4db 100644
--- a/themes/unconed/unconed.theme
+++ b/themes/unconed/unconed.theme
@@ -82,7 +82,7 @@ function unconed_header() {
}
}
-function unconed_node($node, $main = 0) {
+function unconed_node($node, $main = 0, $page = 0) {
$foreground = "#000000";
$background = "#ffffff";
@@ -111,7 +111,13 @@ function unconed_node($node, $main = 0) {
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;">
<tr><td>
<table border="0" cellpadding="4" cellspacing="1" style="width: 100%;">
+ <?php
+ if ($page == 0) {
+ ?>
<tr><td colspan="2" style="background-color: <?php echo $bgcolor1; ?>; width: 100%;"><table cellpadding="0" cellspacing="0" style="width: 100%;"><tr><td style="width: 100%;"><div style="color: <?php echo $fgcolor1; ?>;"><b><?php echo "$node->title"; ?></b></div></td><td style="vertical-align: middle; text-align: center;"><img src="<?php print path_to_theme(); ?>/images/icon.gif" alt="" title="" /></td></tr></table></td></tr>
+ <?php
+ }
+ ?>
<tr style="background-color: <?php echo $bgcolor2; ?>;">
<?php
if (module_exist("taxonomy")) {
diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme
index 6abe6fa8b..182ac7048 100644
--- a/themes/xtemplate/xtemplate.theme
+++ b/themes/xtemplate/xtemplate.theme
@@ -31,7 +31,7 @@ function xtemplate_help($section) {
return $output;
}
-function xtemplate_node($node, $main = 0) {
+function xtemplate_node($node, $main = 0, $page = 0) {
global $xtemplate;
$xtemplate->template->assign(array(
@@ -55,6 +55,10 @@ function xtemplate_node($node, $main = 0) {
$xtemplate->template->assign("links", "");
}
+ if ($page == 0) {
+ $xtemplate->template->parse("node.title");
+ }
+
$xtemplate->template->parse("node");
$output = $xtemplate->template->text("node");
$xtemplate->template->reset("node");
diff --git a/themes/xtemplate/xtemplate.xtmpl b/themes/xtemplate/xtemplate.xtmpl
index e9199c674..73af28cf2 100644
--- a/themes/xtemplate/xtemplate.xtmpl
+++ b/themes/xtemplate/xtemplate.xtmpl
@@ -52,7 +52,9 @@
<!-- BEGIN: node -->
<div class="node">
+ <!-- BEGIN: title -->
<h2><a href="{link}">{title}</a></h2>
+ <!-- END: title -->
<span class="author">Submitted by {author} on {date}.</span>
<span class="taxonomy">{taxonomy}</span>
<div class="content">{content}</div>