summaryrefslogtreecommitdiff
path: root/modules/book/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-13 19:05:02 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-13 19:05:02 +0000
commit0215c5032f5df1cf74c6e86b2a853c95b5ed1e4d (patch)
tree39e47f1c644df59355d957af835f4eb54d484e59 /modules/book/book.module
parentc2d2fb73095a32394dd95e72421aec49fa2cd6f6 (diff)
downloadbrdo-0215c5032f5df1cf74c6e86b2a853c95b5ed1e4d.tar.gz
brdo-0215c5032f5df1cf74c6e86b2a853c95b5ed1e4d.tar.bz2
- The book_admin_orphan() function is using the table() function to render
the orphan pages. Patch by Nick. - The "printer-friendly link" is only shown when the book page is not on the main page. Patch by Nick.
Diffstat (limited to 'modules/book/book.module')
-rw-r--r--modules/book/book.module15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index bc30b2546..c350d9017 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -73,7 +73,9 @@ function book_link($type, $node = 0, $main = 0) {
if (book_access("update", $node)) {
$links[] = l(t("edit this page"), "node/edit/$node->nid", array("title" => t("Suggest an update for this book page.")));
}
- $links[] = l(t("printer-friendly version"), "book/print/$node->nid", array("title" => t("Show a printer-friendly version of this book page and its sub-pages.")));
+ if (!$main) {
+ $links[] = l(t("printer-friendly version"), "book/print/$node->nid", array("title" => t("Show a printer-friendly version of this book page and its sub-pages.")));
+ }
}
if ($type == "admin" && user_access("maintain books")) {
@@ -685,21 +687,22 @@ function book_admin_save($nid, $edit = array()) {
function book_admin_orphan() {
- $result = db_query("SELECT n.nid, n.title, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book'");
+ $result = db_query("SELECT n.nid, n.title, n.status, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book'");
while ($page = db_fetch_object($result)) {
$pages[$page->nid] = $page;
}
if ($pages) {
- $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>title</th><th colspan=\"2\">operations</th></tr>";
+ $output .= "<h3>Orphan pages</h3>";
+ $header = array(t("title"), t("weight"), array("data" => t("operations"), "colspan" => 3));
foreach ($pages as $nid => $node) {
if ($node->parent && empty($pages[$node->parent])) {
- $output .= "<tr><td>". l($node->title, "node/view/$node->nid") ."</td><td>". l(t("edit page"), "admin/node/edit/$node->nid") ."</td><td>". l(t("delete page"), "admin/node/delete/$node->nid") ."</td>";
+ $rows[] = book_admin_view_line($node, $depth);
+ $rows = array_merge($rows, book_admin_view_book($node->nid, $depth + 1));
}
}
- $output .= "</table>";
+ $output .= table($header, $rows);
}
return $output;