summaryrefslogtreecommitdiff
path: root/modules/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-02 15:54:37 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-02 15:54:37 +0000
commit805107cd2202ddee66c4743e43804a3069508f29 (patch)
tree39a0661f2e8a84ee743831ee7abac5c9a626637c /modules/book.module
parent1f5bc83d794906c1b88dde20e107363cf2f71c17 (diff)
downloadbrdo-805107cd2202ddee66c4743e43804a3069508f29.tar.gz
brdo-805107cd2202ddee66c4743e43804a3069508f29.tar.bz2
Commiting my work of last Sunday:
- removed ban.inc and ban.module and integrated it in account.module under the name "access control" --> the ban code was not really up to standard so this has now been dealt with. This refactoring and reintegration cuts down the code size with 100 lines too. :-) (The ban.module code was really old and it showed.) - added node.module and made the other modules reuse some of this code --> cut down the code size of modules by at least 100 lines and adds stability. - added a status() function to admin.php to display a conform status message where appropriate. See admin.php for usage. - removed $theme->control() and made comments.inc handle this itself wrapped in a $theme->box(). No need to clutter the themes with such complexity --> updated all themes already. :-) - some small visual changes to some administration pages to be more consistent across different modules.
Diffstat (limited to 'modules/book.module')
-rw-r--r--modules/book.module22
1 files changed, 2 insertions, 20 deletions
diff --git a/modules/book.module b/modules/book.module
index 04b0eb280..d5e5c0f93 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -154,10 +154,6 @@ function book_save($edit) {
node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "book")), array(userid => $edit[userid])));
}
-function book_delete($id) {
- return ($node = node_del("nid", $id) ? "book page has been deleted" : "failed to delete book page: change status to 'dumped' first");
-}
-
function book_tree($parent = "") {
global $PHP_SELF, $status;
@@ -166,7 +162,7 @@ function book_tree($parent = "") {
$output .= "<UL>";
while ($node = db_fetch_object($result)) {
$output .= "<LI><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A>";
- if ($PHP_SELF == "/admin.php") $output .= " <SMALL>(weight: $node->weight/$node->parent, status: $node->status) (<A HREF=\"admin.php?mod=book&op=edit&id=$node->nid\">edit</A>, <A HREF=\"admin.php?mod=book&op=delete&id=$node->nid\">delete</A>)</SMALL>\n";
+ if ($PHP_SELF == "/admin.php") $output .= " <SMALL>(weight: $node->weight/$node->parent, status: $node->status) (<A HREF=\"admin.php?mod=book&op=edit&id=$node->nid\">edit</A>)</SMALL>\n";
if ($node->pid) $output .= book_tree($node->pid);
$output .= book_tree($node->nid);
}
@@ -175,17 +171,7 @@ function book_tree($parent = "") {
}
function book_list() {
- global $status;
-
- $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status != '$status[expired]' ORDER BY n.timestamp DESC");
-
- $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
- $output .= " <TR><TH>node</TH><TH>status</TH><TH>date</TH><TH COLSPAN=\"3\">operations</TH></TR>\n";
- while ($node = db_fetch_object($result)) {
- $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></TD><TD>$node->status</TD><TD>". format_date($node->timestamp, "small") ."</TD><TD><A HREF=\"node.php?id=$node->nid\">view</A></TD><TD><A HREF=\"admin.php?mod=book&op=edit&id=$node->nid\">edit</A></TD><TD><A HREF=\"admin.php?mod=book&op=delete&id=$node->nid\">delete</A></TD>";
- }
- $output .= "</TABLE>\n";
- return $output;
+ return node_overview("type = 'book'");
}
function book_admin() {
@@ -197,10 +183,6 @@ function book_admin() {
case "add":
print book_form();
break;
- case "delete":
- print book_delete($id);
- print book_tree();
- break;
case "list":
print book_list();
break;