From 30d59fd52ce5d8274480ba9fdeb08bef2cfbcc1b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 27 Jan 2006 18:57:13 +0000 Subject: - Patch #46400 by m3avrck: clean up book navigation markup + UI improvements. (Hint: the forum module has previous and next links too.) --- modules/book.module | 35 ++++++++++------------------------- modules/book/book.module | 35 ++++++++++------------------------- 2 files changed, 20 insertions(+), 50 deletions(-) (limited to 'modules') diff --git a/modules/book.module b/modules/book.module index 2ed3f5c9e..f29156225 100644 --- a/modules/book.module +++ b/modules/book.module @@ -481,44 +481,29 @@ function book_nodeapi(&$node, $op, $teaser, $page) { * @ingroup themeable */ function theme_book_navigation($node) { + $output = ''; + if ($node->nid) { - $output .= '
'; + $output .= '
'; if ($tree = book_tree($node->nid)) { - $output .= '
'. $tree .'
'; + $output .= $tree; } if ($prev = book_prev($node)) { drupal_add_link(array('rel' => 'prev', 'href' => url('node/'. $prev->nid))); - $links .= ''; - $titles .= ''; + $links .= l(t('‹ ') . check_plain($prev->title), 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); } - else { - $links .= ''; // Make an empty div to fill the space. + if ($node->parent) { + drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); + $links .= l(t('up'), 'node/'. $node->parent, array('class' => 'page-up', 'title' => t('Go to parent page'))); } if ($next = book_next($node)) { drupal_add_link(array('rel' => 'next', 'href' => url('node/'. $next->nid))); - $links .= ''; - $titles .= ''; - } - else { - $links .= ''; // Make an empty div to fill the space. - } - if ($node->parent) { - drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); - $links .= '
'; - $links .= l(t('up'), 'node/'. $node->parent, array('title' => t('View this page\'s parent section.'))); - $links .= '
'; + $links .= l(check_plain($next->title) . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); } - $output .= ''; + $output .= ''; $output .= '
'; } diff --git a/modules/book/book.module b/modules/book/book.module index 2ed3f5c9e..f29156225 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -481,44 +481,29 @@ function book_nodeapi(&$node, $op, $teaser, $page) { * @ingroup themeable */ function theme_book_navigation($node) { + $output = ''; + if ($node->nid) { - $output .= '
'; + $output .= '
'; if ($tree = book_tree($node->nid)) { - $output .= '
'. $tree .'
'; + $output .= $tree; } if ($prev = book_prev($node)) { drupal_add_link(array('rel' => 'prev', 'href' => url('node/'. $prev->nid))); - $links .= ''; - $titles .= ''; + $links .= l(t('‹ ') . check_plain($prev->title), 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); } - else { - $links .= ''; // Make an empty div to fill the space. + if ($node->parent) { + drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); + $links .= l(t('up'), 'node/'. $node->parent, array('class' => 'page-up', 'title' => t('Go to parent page'))); } if ($next = book_next($node)) { drupal_add_link(array('rel' => 'next', 'href' => url('node/'. $next->nid))); - $links .= ''; - $titles .= ''; - } - else { - $links .= ''; // Make an empty div to fill the space. - } - if ($node->parent) { - drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); - $links .= '
'; - $links .= l(t('up'), 'node/'. $node->parent, array('title' => t('View this page\'s parent section.'))); - $links .= '
'; + $links .= l(check_plain($next->title) . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); } - $output .= ''; + $output .= ''; $output .= '
'; } -- cgit v1.2.3