summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/book.module2
-rw-r--r--modules/book/book.module2
-rw-r--r--modules/node.module9
-rw-r--r--modules/node/node.module9
-rw-r--r--modules/story.module2
-rw-r--r--modules/story/story.module2
-rw-r--r--modules/structure.module9
7 files changed, 20 insertions, 15 deletions
diff --git a/modules/book.module b/modules/book.module
index 8fe3aea9f..355366e3e 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -157,7 +157,7 @@ function book_form($edit = array()) {
}
function book_save($edit) {
- node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "book")), array(userid => $edit[userid])));
+ node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "book", comment => category_comment($edit[cid]))), array(userid => $edit[userid])));
}
function book_tree($parent = "", $depth = 0) {
diff --git a/modules/book/book.module b/modules/book/book.module
index 8fe3aea9f..355366e3e 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -157,7 +157,7 @@ function book_form($edit = array()) {
}
function book_save($edit) {
- node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "book")), array(userid => $edit[userid])));
+ node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "book", comment => category_comment($edit[cid]))), array(userid => $edit[userid])));
}
function book_tree($parent = "", $depth = 0) {
diff --git a/modules/node.module b/modules/node.module
index 7d0a5b3a5..58b77fd99 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -27,6 +27,7 @@ function node_admin_view($id) {
$output .= "<B>Title:</B><BR>". check_output($node->title) ."<P>\n";
$output .= "<B>Author:</B><BR>". format_username($node->userid) ."<P>\n";
$output .= "<B>Status:</B><BR>". $rstatus[$node->status] ."<P>\n";
+ $output .= "<B>Comment:</B><BR>". comment_status($node->comment) ."<P>\n";
$output .= "<B>Date:</B><BR>". format_date($node->timestamp) ."<P>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Edit node\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Delete node\">\n";
@@ -42,12 +43,14 @@ function node_admin_edit($id) {
foreach (array($node->userid => $node->author, $user->userid => $user->id) as $value=>$key) $author .= " <OPTION VALUE=\"$key\"". (($node->author == $key) ? " SELECTED" : "") .">$value</OPTION>\n";
foreach (array(format_date($node->timestamp) ." (original)" => $node->timestamp, format_date(time()) ." (current)" => time()) as $value=>$key) $timestamp .= " <OPTION VALUE=\"$key\"". (($node->timestamp == $key) ? " SELECTED" : "") .">$value</OPTION>\n";
- foreach (node_status($node) as $value) $statuz .= " <OPTION VALUE=\"". $status[$value] ."\"". (($node->status == $status[$value]) ? " SELECTED" : "") .">$value</OPTION>\n";
+ foreach (node_status($node) as $value) $display .= " <OPTION VALUE=\"". $status[$value] ."\"". (($node->status == $status[$value]) ? " SELECTED" : "") .">$value</OPTION>\n";
+ foreach (comment_status() as $key=>$value) $comment .= " <OPTION VALUE=\"$key\"". ($node->comment == $key ? " SELECTED" : "") .">$value</OPTION>\n";
$output .= "<FORM ACTION=\"admin.php?mod=node&id=$node->nid\" METHOD=\"post\">\n";
$output .= "<B>Title:</B><BR>". check_output($node->title) ."<P>\n";
$output .= "<B>Author:</B><BR><SELECT NAME=\"edit[author]\">$author</SELECT><P>\n";
- $output .= "<B>Status:</B><BR><SELECT NAME=\"edit[status]\">$statuz</SELECT><P>\n";
+ $output .= "<B>Status:</B><BR><SELECT NAME=\"edit[status]\">$display</SELECT><P>\n";
+ $output .= "<B>Comment:</B><BR><SELECT NAME=\"edit[comment]\">$comment</SELECT><P>\n";
$output .= "<B>Date:</B><BR><SELECT NAME=\"edit[timestamp]\">$timestamp</SELECT><P>\n";
$output .= "<INPUT TYPE=\"hidden\" NAME=\"edit[nid]\" VALUE=\"$node->nid\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"View node\">\n";
@@ -96,7 +99,7 @@ function node_admin() {
print node_listing(node_query());
break;
case "Save node":
- print status(node_save($edit));
+ node_save($edit);
print node_admin_view($id);
break;
case "View node":
diff --git a/modules/node/node.module b/modules/node/node.module
index 7d0a5b3a5..58b77fd99 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -27,6 +27,7 @@ function node_admin_view($id) {
$output .= "<B>Title:</B><BR>". check_output($node->title) ."<P>\n";
$output .= "<B>Author:</B><BR>". format_username($node->userid) ."<P>\n";
$output .= "<B>Status:</B><BR>". $rstatus[$node->status] ."<P>\n";
+ $output .= "<B>Comment:</B><BR>". comment_status($node->comment) ."<P>\n";
$output .= "<B>Date:</B><BR>". format_date($node->timestamp) ."<P>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Edit node\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Delete node\">\n";
@@ -42,12 +43,14 @@ function node_admin_edit($id) {
foreach (array($node->userid => $node->author, $user->userid => $user->id) as $value=>$key) $author .= " <OPTION VALUE=\"$key\"". (($node->author == $key) ? " SELECTED" : "") .">$value</OPTION>\n";
foreach (array(format_date($node->timestamp) ." (original)" => $node->timestamp, format_date(time()) ." (current)" => time()) as $value=>$key) $timestamp .= " <OPTION VALUE=\"$key\"". (($node->timestamp == $key) ? " SELECTED" : "") .">$value</OPTION>\n";
- foreach (node_status($node) as $value) $statuz .= " <OPTION VALUE=\"". $status[$value] ."\"". (($node->status == $status[$value]) ? " SELECTED" : "") .">$value</OPTION>\n";
+ foreach (node_status($node) as $value) $display .= " <OPTION VALUE=\"". $status[$value] ."\"". (($node->status == $status[$value]) ? " SELECTED" : "") .">$value</OPTION>\n";
+ foreach (comment_status() as $key=>$value) $comment .= " <OPTION VALUE=\"$key\"". ($node->comment == $key ? " SELECTED" : "") .">$value</OPTION>\n";
$output .= "<FORM ACTION=\"admin.php?mod=node&id=$node->nid\" METHOD=\"post\">\n";
$output .= "<B>Title:</B><BR>". check_output($node->title) ."<P>\n";
$output .= "<B>Author:</B><BR><SELECT NAME=\"edit[author]\">$author</SELECT><P>\n";
- $output .= "<B>Status:</B><BR><SELECT NAME=\"edit[status]\">$statuz</SELECT><P>\n";
+ $output .= "<B>Status:</B><BR><SELECT NAME=\"edit[status]\">$display</SELECT><P>\n";
+ $output .= "<B>Comment:</B><BR><SELECT NAME=\"edit[comment]\">$comment</SELECT><P>\n";
$output .= "<B>Date:</B><BR><SELECT NAME=\"edit[timestamp]\">$timestamp</SELECT><P>\n";
$output .= "<INPUT TYPE=\"hidden\" NAME=\"edit[nid]\" VALUE=\"$node->nid\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"View node\">\n";
@@ -96,7 +99,7 @@ function node_admin() {
print node_listing(node_query());
break;
case "Save node":
- print status(node_save($edit));
+ node_save($edit);
print node_admin_view($id);
break;
case "View node":
diff --git a/modules/story.module b/modules/story.module
index 484574d35..88550443a 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -106,7 +106,7 @@ function story_form($edit = array()) {
}
function story_save($edit) {
- node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "story")), array(userid => $edit[userid])));
+ node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "story", comment => category_comment($edit[cid]))), array(userid => $edit[userid])));
}
function story_block() {
diff --git a/modules/story/story.module b/modules/story/story.module
index 484574d35..88550443a 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -106,7 +106,7 @@ function story_form($edit = array()) {
}
function story_save($edit) {
- node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "story")), array(userid => $edit[userid])));
+ node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "story", comment => category_comment($edit[cid]))), array(userid => $edit[userid])));
}
function story_block() {
diff --git a/modules/structure.module b/modules/structure.module
index 6e921ec0d..5fa361bd9 100644
--- a/modules/structure.module
+++ b/modules/structure.module
@@ -2,7 +2,6 @@
$module = array("admin" => "structure_admin");
-$cstatus = array("disabled", "enabled");
$mstatus = array("post new submissions", "moderate new submissions");
function content_types($name, $module) {
@@ -11,7 +10,7 @@ function content_types($name, $module) {
}
function category_form($edit = array()) {
- global $types, $cstatus, $mstatus;
+ global $types, $mstatus;
$threshold_post = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100);
$threshold_dump = array(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -20, -25, -30);
@@ -31,7 +30,7 @@ function category_form($edit = array()) {
$output .= "<SMALL><I>The content type to bind or associate this category with.</I></SMALL><P>\n";
$output .= "<B>Comment settings:</B><BR>\n";
- foreach ($cstatus as $key=>$value) $options2 .= "<OPTION VALUE=\"$key\"". ($edit[comment] == $key ? " SELECTED" : "") .">". check_select($value) ."</OPTION>";
+ foreach (comment_status() as $key=>$value) $options2 .= "<OPTION VALUE=\"$key\"". ($edit[comment] == $key ? " SELECTED" : "") .">". check_select($value) ."</OPTION>";
$output .= "<SELECT NAME=\"edit[comment]\">$options2</SELECT><BR>\n";
$output .= "<SMALL><I>Allow or dissallow users to post comments in this category.</I></SMALL><P>\n";
@@ -65,14 +64,14 @@ function category_form($edit = array()) {
}
function category_overview() {
- global $cstatus, $mstatus;
+ global $mstatus;
$result = db_query("SELECT * FROM category ORDER BY name");
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>name</TH><TH>type</TH><TH>comments</TH><TH>submissions</TH><TH>operations</TH></TR>\n";
while ($category = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". check_output($cstatus[$category->comment]) ."</TD><TD>". check_output($mstatus[$category->submission]) ."". ($category->submission ? "<BR><SMALL>post: $category->post, dump: $category->dump, expire: $category->expire</SMALL>" : "") ."</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". comment_status($category->comment) ."</TD><TD>". check_output($mstatus[$category->submission]) ."". ($category->submission ? "<BR><SMALL>post: $category->post, dump: $category->dump, expire: $category->expire</SMALL>" : "") ."</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
return $output;