diff options
-rw-r--r-- | modules/blog.module | 5 | ||||
-rw-r--r-- | modules/blog/blog.module | 5 | ||||
-rw-r--r-- | modules/book.module | 42 | ||||
-rw-r--r-- | modules/book/book.module | 42 | ||||
-rw-r--r-- | modules/story.module | 5 | ||||
-rw-r--r-- | modules/story/story.module | 5 |
6 files changed, 66 insertions, 38 deletions
diff --git a/modules/blog.module b/modules/blog.module index d5517adbd..9bdf72cc9 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -162,7 +162,10 @@ function blog_form($edit = array()) { $form .= form_hidden("nid", $edit["nid"]); } - if ($edit && !$edit["title"]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit["title"]) { $form .= "<font color=\"red\">". t("Warning: you did not supply a subject.") ."</font><p>\n"; $form .= form_submit(t("Preview")); } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index d5517adbd..9bdf72cc9 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -162,7 +162,10 @@ function blog_form($edit = array()) { $form .= form_hidden("nid", $edit["nid"]); } - if ($edit && !$edit["title"]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit["title"]) { $form .= "<font color=\"red\">". t("Warning: you did not supply a subject.") ."</font><p>\n"; $form .= form_submit(t("Preview")); } diff --git a/modules/book.module b/modules/book.module index fa9c80e01..679b046b4 100644 --- a/modules/book.module +++ b/modules/book.module @@ -149,7 +149,10 @@ function book_form($edit = array()) { $form .= form_hidden("pid", $edit[pid]); } - if ($edit && !$edit[title]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit[title]) { $form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a title.") ."</FONT><P>\n"; $form .= form_submit(t("Preview")); } @@ -227,19 +230,32 @@ function book_admin() { } } -function book_page() { +function book_render() { global $status, $theme; + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); + + while ($node = db_fetch_object($result)) { + $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; + } + + $theme->header(); + $theme->box(t("Handbook"), "<DL>$output</DL>"); + $theme->footer(); +} + +function book_page() { + global $op, $id, $theme; + if (user_access("access content")) { - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); - while ($node = db_fetch_object($result)) { - $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; + switch ($op) { + case "feed": + print book_export_html($i, $depth = 1); + break; + default: + book_render(); } - - $theme->header(); - $theme->box(t("Handbook"), "<DL>$output</DL>"); - $theme->footer(); } else { $theme->header(); @@ -300,12 +316,4 @@ function book_export_html($parent = "", $depth = 0) { return $output; } -function book_export($query) { - global $book; - - if ($book) { - print book_export_html($book, $depth = 1); - } -} - ?> diff --git a/modules/book/book.module b/modules/book/book.module index fa9c80e01..679b046b4 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -149,7 +149,10 @@ function book_form($edit = array()) { $form .= form_hidden("pid", $edit[pid]); } - if ($edit && !$edit[title]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit[title]) { $form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a title.") ."</FONT><P>\n"; $form .= form_submit(t("Preview")); } @@ -227,19 +230,32 @@ function book_admin() { } } -function book_page() { +function book_render() { global $status, $theme; + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); + + while ($node = db_fetch_object($result)) { + $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; + } + + $theme->header(); + $theme->box(t("Handbook"), "<DL>$output</DL>"); + $theme->footer(); +} + +function book_page() { + global $op, $id, $theme; + if (user_access("access content")) { - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); - while ($node = db_fetch_object($result)) { - $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; + switch ($op) { + case "feed": + print book_export_html($i, $depth = 1); + break; + default: + book_render(); } - - $theme->header(); - $theme->box(t("Handbook"), "<DL>$output</DL>"); - $theme->footer(); } else { $theme->header(); @@ -300,12 +316,4 @@ function book_export_html($parent = "", $depth = 0) { return $output; } -function book_export($query) { - global $book; - - if ($book) { - print book_export_html($book, $depth = 1); - } -} - ?> diff --git a/modules/story.module b/modules/story.module index fa55cece3..9ce78fd2c 100644 --- a/modules/story.module +++ b/modules/story.module @@ -57,7 +57,10 @@ function story_form($edit = array()) { $form .= form_hidden("nid", $edit[nid]); } - if ($edit && !$edit[title]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit[title]) { $form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a subject.") ."</FONT><P>\n"; $form .= form_submit(t("Preview")); } diff --git a/modules/story/story.module b/modules/story/story.module index fa55cece3..9ce78fd2c 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -57,7 +57,10 @@ function story_form($edit = array()) { $form .= form_hidden("nid", $edit[nid]); } - if ($edit && !$edit[title]) { + if (!$edit) { + $form .= form_submit(t("Preview")); + } + else if ($edit && !$edit[title]) { $form .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a subject.") ."</FONT><P>\n"; $form .= form_submit(t("Preview")); } |