diff options
-rw-r--r-- | misc/drupal.css | 45 | ||||
-rw-r--r-- | modules/book.module | 35 | ||||
-rw-r--r-- | modules/book/book.module | 35 |
3 files changed, 30 insertions, 85 deletions
diff --git a/misc/drupal.css b/misc/drupal.css index d235803e3..c76dce948 100644 --- a/misc/drupal.css +++ b/misc/drupal.css @@ -228,49 +228,24 @@ tr.odd .form-item, tr.even .form-item { margin-bottom: 1em; margin-top: 0; } -.book { - margin: 1em 0 1em 0; -} -.book .title { - font-weight: bold; - font-size: 1.3em; - margin-bottom: 1em; -} -.book .tree { - padding-top: 1em; +.book-navigation .menu { border-top: 1px solid #888; - padding-bottom: 1em; -} -.book .name { - padding-top: 1em; - font-weight: bold; - font-size: 1em; + padding: 1em 0 0 3em; } -.book .nav { +.book-navigation .page-links { border-top: 1px solid #888; border-bottom: 1px solid #888; - padding-bottom: 3em; - padding-top: 1em; - clear: both; + text-align: center; + padding: 0.5em; } -.book .nav .links { - clear: both; +.book-navigation .page-previous { + text-align: right; } -.book .nav .titles { - clear: both; +.book-navigation .page-up { + margin: 0 4em; } -.book .nav .prev { - float: left; +.book-navigation .page-next { text-align: left; - width: 45%; -} -.book .nav .next { - float: right; - text-align: right; - width: 45%; -} -.book .nav .up { - text-align: center; } .calendar .row-week td a { display: block; 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>'; } |