From 24e76c0d6cb21dfe7aaadbc8c6ba1198e7da79dc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 17 Jan 2004 23:34:11 +0000 Subject: - Code beautifications: corrected indentation. --- modules/book.module | 88 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) (limited to 'modules/book.module') diff --git a/modules/book.module b/modules/book.module index 2c182ba7a..56ba8e6d6 100644 --- a/modules/book.module +++ b/modules/book.module @@ -498,56 +498,58 @@ function book_show($node, $cid) { function book_navigation($node) { - $path = book_location($node); + $path = book_location($node); - /* - ** Construct the breadcrumb: - */ + /* + ** Construct the breadcrumb: + */ + + $node->breadcrumb = ""; // Overwrite the trail with a book trail. + $node->breadcrumb[] = l(t("Home"), ""); + foreach ($path as $level) { + $node->breadcrumb[] = l($level->title, "book/view/$level->nid"); + } + + if ($node->nid) { + $output .= "
"; - $node->breadcrumb = ""; // Overwrite the trail with a book trail. - $node->breadcrumb[] = l(t("Home"), ""); - foreach ($path as $level) { - $node->breadcrumb[] = l($level->title, "book/view/$level->nid"); + if ($tree = book_tree($node->nid)) { + $output .= "
". book_tree($node->nid) ."
"; } - if ($node->nid) { - $output .= "
"; + if ($prev = book_prev($node)) { + $links .= "
"; + $links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page."))); + $links .= "
"; + $titles .= "
$prev->title
"; + } + else { + $links .= "
 
"; // make an empty div to fill the space + } + if ($next = book_next($node)) { + $links .= "
"; + $links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page."))); + $links .= "
"; + $titles .= "
$next->title
"; + } + else { + $links .= "
 
"; // make an empty div to fill the space + } + if ($node->parent) { + $links .= "
"; + $links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section."))); + $links .= "
"; + } - if ($tree = book_tree($node->nid)) { - $output .= "
". book_tree($node->nid) ."
"; - } + $output .= "
"; + $output .= "
$links
"; + $output .= "
$titles
"; + $output .= "
"; + $output .= "
"; + } - if ($prev = book_prev($node)) { - $links .= "
"; - $links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page."))); - $links .= "
"; - $titles .= "
$prev->title
"; - } - else { - $links .= "
 
"; // make an empty div to fill the space - } - if ($next = book_next($node)) { - $links .= "
"; - $links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page."))); - $links .= "
"; - $titles .= "
$next->title
"; - } - else { - $links .= "
 
"; // make an empty div to fill the space - } - if ($node->parent) { - $links .= "
"; - $links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section."))); - $links .= "
"; - } + $node->body = $node->body.$output; - $output .= "
"; - $output .= "
$links
"; - $output .= "
$titles
"; - $output .= "
"; - $output .= "
"; - } - $node->body = $node->body.$output; return $node; } -- cgit v1.2.3