diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-01-27 18:57:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-01-27 18:57:13 +0000 |
commit | 30d59fd52ce5d8274480ba9fdeb08bef2cfbcc1b (patch) | |
tree | 24691ccfb270bb5019b001fe5c0f39e64e915e45 /modules | |
parent | 9b47a147f352d7706bf4bf22f81814f40773b99a (diff) | |
download | brdo-30d59fd52ce5d8274480ba9fdeb08bef2cfbcc1b.tar.gz brdo-30d59fd52ce5d8274480ba9fdeb08bef2cfbcc1b.tar.bz2 |
- Patch #46400 by m3avrck: clean up book navigation markup + UI improvements. (Hint: the forum module has previous and next links too.)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/book.module | 35 | ||||
-rw-r--r-- | modules/book/book.module | 35 |
2 files changed, 20 insertions, 50 deletions
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 .= '<div class="book">'; + $output .= '<div class="book-navigation">'; if ($tree = book_tree($node->nid)) { - $output .= '<div class="tree">'. $tree .'</div>'; + $output .= $tree; } if ($prev = book_prev($node)) { drupal_add_link(array('rel' => 'prev', 'href' => url('node/'. $prev->nid))); - $links .= '<div class="prev">'; - $links .= l(t('previous'), 'node/'. $prev->nid, array('title' => t('View the previous page.'))); - $links .= '</div>'; - $titles .= '<div class="prev">'. check_plain($prev->title) .'</div>'; + $links .= l(t('‹ ') . check_plain($prev->title), 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); } - else { - $links .= '<div class="prev"> </div>'; // 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 .= '<div class="next">'; - $links .= l(t('next'), 'node/'. $next->nid, array('title' => t('View the next page.'))); - $links .= '</div>'; - $titles .= '<div class="next">'. check_plain($next->title) .'</div>'; - } - else { - $links .= '<div class="next"> </div>'; // Make an empty div to fill the space. - } - if ($node->parent) { - drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); - $links .= '<div class="up">'; - $links .= l(t('up'), 'node/'. $node->parent, array('title' => t('View this page\'s parent section.'))); - $links .= '</div>'; + $links .= l(check_plain($next->title) . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); } - $output .= '<div class="nav">'; - $output .= ' <div class="links">'. $links .'</div>'; - $output .= ' <div class="titles">'. $titles .'</div>'; - $output .= '</div>'; + $output .= '<div class="page-links">'. $links .'</div>'; $output .= '</div>'; } 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 .= '<div class="book">'; + $output .= '<div class="book-navigation">'; if ($tree = book_tree($node->nid)) { - $output .= '<div class="tree">'. $tree .'</div>'; + $output .= $tree; } if ($prev = book_prev($node)) { drupal_add_link(array('rel' => 'prev', 'href' => url('node/'. $prev->nid))); - $links .= '<div class="prev">'; - $links .= l(t('previous'), 'node/'. $prev->nid, array('title' => t('View the previous page.'))); - $links .= '</div>'; - $titles .= '<div class="prev">'. check_plain($prev->title) .'</div>'; + $links .= l(t('‹ ') . check_plain($prev->title), 'node/'. $prev->nid, array('class' => 'page-previous', 'title' => t('Go to previous page'))); } - else { - $links .= '<div class="prev"> </div>'; // 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 .= '<div class="next">'; - $links .= l(t('next'), 'node/'. $next->nid, array('title' => t('View the next page.'))); - $links .= '</div>'; - $titles .= '<div class="next">'. check_plain($next->title) .'</div>'; - } - else { - $links .= '<div class="next"> </div>'; // Make an empty div to fill the space. - } - if ($node->parent) { - drupal_add_link(array('rel' => 'index', 'href' => url('node/'. $node->parent))); - $links .= '<div class="up">'; - $links .= l(t('up'), 'node/'. $node->parent, array('title' => t('View this page\'s parent section.'))); - $links .= '</div>'; + $links .= l(check_plain($next->title) . t(' ›'), 'node/'. $next->nid, array('class' => 'page-next', 'title' => t('Go to next page'))); } - $output .= '<div class="nav">'; - $output .= ' <div class="links">'. $links .'</div>'; - $output .= ' <div class="titles">'. $titles .'</div>'; - $output .= '</div>'; + $output .= '<div class="page-links">'. $links .'</div>'; $output .= '</div>'; } |