diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-09-15 15:58:20 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-09-15 15:58:20 +0000 |
commit | d9cb4522bd0f445eef49316a5c9dd798e2803754 (patch) | |
tree | 8bfbeb2c292df21f15252ae47c631ec026934c13 /modules/node/node.module | |
parent | 7e60456ca98e9faa12fcf2ea56ee57f31c6450af (diff) | |
download | brdo-d9cb4522bd0f445eef49316a5c9dd798e2803754.tar.gz brdo-d9cb4522bd0f445eef49316a5c9dd798e2803754.tar.bz2 |
- 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.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 17 |
1 files changed, 12 insertions, 5 deletions
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")) { |