From 53e128807a0e2d6e9e3377052cd0897d9d9f598e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 2 Dec 2001 21:05:31 +0000 Subject: - Added "add new comment"-link (derived from a patch by Axel) --- modules/book.module | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/book.module') diff --git a/modules/book.module b/modules/book.module index 342a03136..c17f96064 100644 --- a/modules/book.module +++ b/modules/book.module @@ -80,7 +80,7 @@ function book_save($op, $node) { } -function book_link($type) { +function book_link($type, $node = 0) { if ($type == "page" && user_access("access content")) { $links[] = "". t("collaborative book") .""; } @@ -89,6 +89,10 @@ function book_link($type) { $links[] = "". t("collaborative book") .""; } + if ($type == "node" && $node->type == "book") { + $links[] = "nid\">". t("update this book page") .""; + } + return $links ? $links : array(); } @@ -245,7 +249,7 @@ function book_view($node, $main = 0) { $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = '$node->parent' AND (b.weight < '$node->weight' OR (b.weight = '$node->weight' AND n.title < '". check_query($node->title) ."')) AND (n.moderate = 0 OR n.revisions != '') ORDER BY b.weight DESC, n.title DESC")); } - $output .= "\n"; + $output .= "
"; if ($node->title) { foreach (book_location($node) as $level) { @@ -253,7 +257,7 @@ function book_view($node, $main = 0) { $indent .= "-"; } - $output .= " "; + $output .= " "; $output .= " "; $output .= " "; } @@ -269,6 +273,8 @@ function book_view($node, $main = 0) { $output .= " "; $output .= " "; $output .= " "; + $output .= " "; + $output .= " "; $output .= "
$locationnid\">". t("update this book page") ."
$location

". check_output($node->title) ."". ($node->body ? "
". sprintf(t("Last updated by %s on %s"), format_name($node), format_date($node->created)) ." " : "") ."

". ($prev ? "nid\">". t("previous") ."" : t("previous")) ."index". ($next ? "nid\">". t("next") ."" : t("next")) ."
". ($prev ? "". check_output($prev->title) ."" : " ") ."". ($node->parent ? "parent\">". t("up") ."" : t("up")) ."". ($next ? "". check_output($next->title) ."" : " ") ."

". $theme->links(link_node($node, $main)) ."
"; $theme->box(t("Handbook"), $output); -- cgit v1.2.3