From d9cb4522bd0f445eef49316a5c9dd798e2803754 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 15 Sep 2003 15:58:20 +0000 Subject: - Book module improvements. This commit changes the behavior of the "view" hook. See mailing list for details; search for a mail with the subject: '[IMPORTANT] behavior of "view" hook changed'. Modified patch from Nick. --- modules/node/node.module | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index ef26aedb9..eda827042 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -65,7 +65,7 @@ function node_system($field){ $output = ""; if ($field == "description") {$output = node_help("admin/system/modules"); } - else if ($field == "admin-help") {$output = node_help("admin/system/modules/node");}; + else if ($field == "admin_help") {$output = node_help("admin/system/modules/node");}; return $output; } @@ -372,7 +372,7 @@ function node_save($node) { } -function node_view($node, $main = 0) { +function node_view($node, $main = 0, $return = 0) { $node = array2object($node); @@ -389,7 +389,7 @@ function node_view($node, $main = 0) { */ if (module_hook($node->type, "view")) { - node_invoke($node, "view", $main); + $node = node_invoke($node, "view", $main, $return); } else { @@ -399,9 +399,17 @@ function node_view($node, $main = 0) { $node->teaser = check_output($node->teaser); $node->body = check_output($node->body); + } + if (!$return) { + if ($node->trail) { + theme("breadcrumb", $node->trail); + } theme("node", $node, $main); } + else { + return $node; + } } function node_show($node, $cid) { @@ -540,8 +548,7 @@ function node_link($type, $node = 0, $main = 0) { if ($main == 1 && $node->teaser && strlen($node->teaser) != strlen($node->body)) { - $links[] = l(t("read more"), "node/view/$node->nid", array("title" => t("Read -the rest of this posting."), "class" => "read-more")); + $links[] = l(t("read more"), "node/view/$node->nid", array("title" => t("Read the rest of this posting."), "class" => "read-more")); } if (user_access("administer nodes")) { -- cgit v1.2.3