Commit 30d59fd5 authored by Dries's avatar Dries

- Patch #46400 by m3avrck: clean up book navigation markup + UI improvements. ...

- Patch #46400 by m3avrck: clean up book navigation markup + UI improvements.  (Hint: the forum module has previous and next links too.)
parent 9b47a147
......@@ -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;
......
......@@ -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">&nbsp;</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">&nbsp;</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>';
}
......
......@@ -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">&nbsp;</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">&nbsp;</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>';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment