diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
commit | 18d22419f3da39ca4bf92f46d605a25957f311be (patch) | |
tree | d72732b1a23d479c4f2adc4d671d8ec901e2a187 /modules/book/book.module | |
parent | 9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff) | |
download | brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2 |
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'modules/book/book.module')
-rw-r--r-- | modules/book/book.module | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/book/book.module b/modules/book/book.module index c5b0d17d5..294076d30 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -61,12 +61,12 @@ function book_perm() { } /** - * Implementation of hook_link(). + * Inject links into $node as needed. */ -function book_link($type, $node = NULL, $teaser = FALSE) { +function book_nodeapi_view_link($node, $teaser, $page) { $links = array(); - - if ($type == 'node' && isset($node->book)) { + + if (isset($node->book['depth'])) { if (!$teaser) { $child_type = variable_get('book_child_type', 'book'); if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { @@ -87,7 +87,12 @@ function book_link($type, $node = NULL, $teaser = FALSE) { } } - return $links; + if (!empty($links)) { + $node->content['links']['book'] = array( + '#type' => 'node_links', + '#value' => $links, + ); + } } /** @@ -732,6 +737,8 @@ function book_nodeapi_view($node, $teaser, $page) { } } } + + book_nodeapi_view_link($node, $teaser, $page); } /** |