diff options
Diffstat (limited to 'modules/book.module')
-rw-r--r-- | modules/book.module | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/modules/book.module b/modules/book.module index 250d8e4f6..8d214dec7 100644 --- a/modules/book.module +++ b/modules/book.module @@ -480,15 +480,11 @@ function theme_book_navigation($node) { $output = ''; if ($node->nid) { - $output .= '<div class="book-navigation">'; - - if ($tree = book_tree($node->nid)) { - $output .= $tree; - } + $tree = book_tree($node->nid); if ($prev = book_prev($node)) { drupal_add_link(array('rel' => 'prev', 'href' => url('node/'. $prev->nid))); - $links .= l(t('‹ ') . check_plain($prev->title), 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); + $links .= l(t('‹ ') . $prev->title, 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); } if ($node->parent) { drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); @@ -496,11 +492,19 @@ function theme_book_navigation($node) { } if ($next = book_next($node)) { drupal_add_link(array('rel' => 'next', 'href' => url('node/'. $next->nid))); - $links .= l(check_plain($next->title) . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); + $links .= l($next->title . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); } - $output .= '<div class="page-links">'. $links .'</div>'; - $output .= '</div>'; + if (isset($tree) || isset($links)) { + $output = '<div class="book-navigation">'; + if (isset($tree)) { + $output .= $tree; + } + if (isset($links)) { + $output .= '<div class="page-links">'. $links .'</div>'; + } + $output .= '</div>'; + } } return $output; |