summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-03-07 22:11:44 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-03-07 22:11:44 +0000
commit831ee213032623aefb9d40cc0ebb97234e56fa63 (patch)
tree1fc05827a5fd28106c8ee001eb61f89ddcd39ee1 /modules/comment/comment.module
parent3aba0fda70b825a588d20d6f9797acab9418c436 (diff)
downloadbrdo-831ee213032623aefb9d40cc0ebb97234e56fa63.tar.gz
brdo-831ee213032623aefb9d40cc0ebb97234e56fa63.tar.bz2
- Renamed "form.admin" to "form admin".
- Added node_admin_settings() to let users set node defaults. * Added _nodeapi("conf") - Modified form_checkbox() to unset options. (Modified the patch from Ax.) - Removed the _save() hook. - Fixed a logical flaw in field_get() and field_set() which would break moderation. - Moved some admin menus around and cleaned up some typos.
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;
}
}