summaryrefslogtreecommitdiff
path: root/modules/book/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-08-10 15:42:33 +0000
committerDries Buytaert <dries@buytaert.net>2006-08-10 15:42:33 +0000
commitce85b7c7f806126f6c4487cde54a990cfa8d1eba (patch)
tree30d6bd007dc5b3f754dbbc575ffc4bd3c55a0c62 /modules/book/book.module
parentba9f7f17946e35bac44c4dbdbef3bcd8d9a8e8f9 (diff)
downloadbrdo-ce85b7c7f806126f6c4487cde54a990cfa8d1eba.tar.gz
brdo-ce85b7c7f806126f6c4487cde54a990cfa8d1eba.tar.bz2
- Patch #74326 by Eaton, Royboy, chx, et al: building $node->body with arrays like FAPI for viewing.
Once again, we're paving the path for CCK in core ... :)
Diffstat (limited to 'modules/book/book.module')
-rw-r--r--modules/book/book.module21
1 files changed, 7 insertions, 14 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index f389b4f7e..a6c59fdf5 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -440,16 +440,6 @@ function book_content($node, $teaser = FALSE) {
}
/**
- * Implementation of hook_view().
- *
- * If not displayed on the main page, we render the node as a page in the
- * book with extra links to the previous and next pages.
- */
-function book_view(&$node, $teaser = FALSE, $page = FALSE) {
- $node = node_prepare($node, $teaser);
-}
-
-/**
* Implementation of hook_nodeapi().
*
* Appends book navigation to all nodes in the book.
@@ -472,7 +462,10 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
}
$node->breadcrumb[] = array('path' => 'node/'. $node->nid);
- $node->body .= theme('book_navigation', $node);
+ $node->content['book_navigation'] = array(
+ '#value' => theme('book_navigation', $node),
+ '#weight' => 100,
+ );
if ($page) {
menu_set_location($node->breadcrumb);
@@ -807,7 +800,7 @@ function book_node_visitor_html_pre($node, $depth, $nid) {
$output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n";
if ($node->body) {
- $output .= $node->body;
+ $output .= drupal_render($node->content);
}
return $output;
}
@@ -868,8 +861,8 @@ function theme_book_admin_table($form) {
$nid = $form[$key]['nid']['#value'];
$pid = $form[0]['nid']['#value'];
$rows[] = array(
- '<div style="padding-left: '. (25 * $form[$key]['depth']['#value']) .'px;">'. form_render($form[$key]['title']) .'</div>',
- form_render($form[$key]['weight']),
+ '<div style="padding-left: '. (25 * $form[$key]['depth']['#value']) .'px;">'. drupal_render($form[$key]['title']) .'</div>',
+ drupal_render($form[$key]['weight']),
l(t('view'), 'node/'. $nid),
l(t('edit'), 'node/'. $nid .'/edit'),
l(t('delete'), 'node/'. $nid .'/delete', NULL, 'destination=admin/content/book'. (arg(3) == 'orphan' ? '/orphan' : '') . ($pid != $nid ? '/'.$pid : ''))