Commit 24e76c0d authored by Dries's avatar Dries

- Code beautifications: corrected indentation.
parent ebf57d17
......@@ -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 .= "<div class=\"book\">";
$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 .= "<div class=\"tree\">". book_tree($node->nid) ."</div>";
}
if ($node->nid) {
$output .= "<div class=\"book\">";
if ($prev = book_prev($node)) {
$links .= "<div class=\"prev\">";
$links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page.")));
$links .= "</div>";
$titles .= "<div class=\"prev\">$prev->title</div>";
}
else {
$links .= "<div class=\"prev\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($next = book_next($node)) {
$links .= "<div class=\"next\">";
$links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page.")));
$links .= "</div>";
$titles .= "<div class=\"next\">$next->title</div>";
}
else {
$links .= "<div class=\"next\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($node->parent) {
$links .= "<div class=\"up\">";
$links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section.")));
$links .= "</div>";
}
if ($tree = book_tree($node->nid)) {
$output .= "<div class=\"tree\">". book_tree($node->nid) ."</div>";
}
$output .= "<div class=\"nav\">";
$output .= " <div class=\"links\">$links</div>";
$output .= " <div class=\"titles\">$titles</div>";
$output .= "</div>";
$output .= "</div>";
}
if ($prev = book_prev($node)) {
$links .= "<div class=\"prev\">";
$links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page.")));
$links .= "</div>";
$titles .= "<div class=\"prev\">$prev->title</div>";
}
else {
$links .= "<div class=\"prev\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($next = book_next($node)) {
$links .= "<div class=\"next\">";
$links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page.")));
$links .= "</div>";
$titles .= "<div class=\"next\">$next->title</div>";
}
else {
$links .= "<div class=\"next\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($node->parent) {
$links .= "<div class=\"up\">";
$links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section.")));
$links .= "</div>";
}
$node->body = $node->body.$output;
$output .= "<div class=\"nav\">";
$output .= " <div class=\"links\">$links</div>";
$output .= " <div class=\"titles\">$titles</div>";
$output .= "</div>";
$output .= "</div>";
}
$node->body = $node->body.$output;
return $node;
}
......
......@@ -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 .= "<div class=\"book\">";
$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 .= "<div class=\"tree\">". book_tree($node->nid) ."</div>";
}
if ($node->nid) {
$output .= "<div class=\"book\">";
if ($prev = book_prev($node)) {
$links .= "<div class=\"prev\">";
$links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page.")));
$links .= "</div>";
$titles .= "<div class=\"prev\">$prev->title</div>";
}
else {
$links .= "<div class=\"prev\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($next = book_next($node)) {
$links .= "<div class=\"next\">";
$links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page.")));
$links .= "</div>";
$titles .= "<div class=\"next\">$next->title</div>";
}
else {
$links .= "<div class=\"next\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($node->parent) {
$links .= "<div class=\"up\">";
$links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section.")));
$links .= "</div>";
}
if ($tree = book_tree($node->nid)) {
$output .= "<div class=\"tree\">". book_tree($node->nid) ."</div>";
}
$output .= "<div class=\"nav\">";
$output .= " <div class=\"links\">$links</div>";
$output .= " <div class=\"titles\">$titles</div>";
$output .= "</div>";
$output .= "</div>";
}
if ($prev = book_prev($node)) {
$links .= "<div class=\"prev\">";
$links .= l(t("previous"), "book/view/$prev->nid", array("title" => t("View the previous page.")));
$links .= "</div>";
$titles .= "<div class=\"prev\">$prev->title</div>";
}
else {
$links .= "<div class=\"prev\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($next = book_next($node)) {
$links .= "<div class=\"next\">";
$links .= l(t("next"), "book/view/$next->nid", array("title" => t("View the next page.")));
$links .= "</div>";
$titles .= "<div class=\"next\">$next->title</div>";
}
else {
$links .= "<div class=\"next\">&nbsp;</div>"; // make an empty div to fill the space
}
if ($node->parent) {
$links .= "<div class=\"up\">";
$links .= l(t("up"), "book/view/$node->parent", array("title" => t("View this page's parent section.")));
$links .= "</div>";
}
$node->body = $node->body.$output;
$output .= "<div class=\"nav\">";
$output .= " <div class=\"links\">$links</div>";
$output .= " <div class=\"titles\">$titles</div>";
$output .= "</div>";
$output .= "</div>";
}
$node->body = $node->body.$output;
return $node;
}
......
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