diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-12-29 07:41:44 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-12-29 07:41:44 +0000 |
commit | c2d394427331ccb6e1fb075119f5756a1d650034 (patch) | |
tree | a210024b2852c4992cd9f6db213aa036d3d7708f | |
parent | 3074b97f4343e5489f93a6961ed132f6e7eb3b40 (diff) | |
download | brdo-c2d394427331ccb6e1fb075119f5756a1d650034.tar.gz brdo-c2d394427331ccb6e1fb075119f5756a1d650034.tar.bz2 |
#100963 by Eaton. Use new pattern for node rendering in printer-friendly version.
-rw-r--r-- | modules/book/book.module | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/modules/book/book.module b/modules/book/book.module index c56725f3c..f8b8903e8 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -716,6 +716,8 @@ function theme_book_export_html($title, $content) { * title order). Finally appends the output of the $visit_post() * callback to the output before returning the generated output. * + * @todo This is duplicitous with node_build_content(). + * * @param nid * - the node id (nid) of the root node of the book hierarchy. * @param depth @@ -778,19 +780,25 @@ function book_recurse($nid = 0, $depth = 1, $visit_pre, $visit_post) { * - the HTML generated for the given node. */ function book_node_visitor_html_pre($node, $depth, $nid) { - // Output the content: - if (node_hook($node, 'content')) { - $node = node_invoke($node, 'content'); + // Remove the delimiter (if any) that separates the teaser from the body. + $node->body = str_replace('<break>', '', $node->body); + + // The 'view' hook can be implemented to overwrite the default function + // to display nodes. + if (node_hook($node, 'view')) { + $node = node_invoke($node, 'view', FALSE, FALSE); + } + else { + $node = node_prepare($node, FALSE); } - // Allow modules to change $node->body before viewing. - node_invoke_nodeapi($node, 'print', $node->body, FALSE); + + // Allow modules to make their own additions to the node. + node_invoke_nodeapi($node, 'print'); $output .= "<div id=\"node-". $node->nid ."\" class=\"section-$depth\">\n"; $output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n"; + $output .= drupal_render($node->content); - if ($node->body) { - $output .= drupal_render($node->content); - } return $output; } |