summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module20
1 files changed, 14 insertions, 6 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 7c610a284..c6182d09f 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -671,7 +671,7 @@ function comment_link($type, $node = 0, $main = 0) {
// comment settings:
if (user_access("administer moderation")) {
menu("admin/comment/votes", "comment moderation votes", "comment_admin", $help["settings"], 5);
- menu("admin/comment/matrix", "ccomment moderation matrix", "comment_admin", $help["settings"], 5);
+ menu("admin/comment/matrix", "comment moderation matrix", "comment_admin", $help["settings"], 5);
menu("admin/comment/filters", "comment moderation thresholds", "comment_admin", $help["settings"], 5);
menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["settings"], 5);
}
@@ -1491,13 +1491,21 @@ function comment_update_index() {
function comment_nodeapi(&$node, $op, $arg = 0) {
switch ($op) {
- case "form":
- if ($arg == "admin" && user_access("administer comments")) {
- return form_select(t("Allow user comments"), "comment", $node->comment, array(t("Disabled"), t("Read only"), t("Read-write")));
- }
- break;
+ case "conf":
+ $output[t("Comment")] = form_select("", "comment_$node->type", variable_get("comment_$node->type", 2), array("Disabled", "Read only", "Read/Write"));
+ return $output;
case "fields":
return array("comment");
+ case "form admin":
+ if (user_access("administer comments")) {
+ return form_select(t("Allow user comments"), "comment", isset($node->comment) ? $node->comment : variable_get("comment_$node->type", 2), array(t("Disabled"), t("Read only"), t("Read-write")));
+ }
+ break;
+ case "validate":
+ if (!user_access("administer nodes")) {
+ unset($node->comment);
+ }
+ break;
}
}