From 831ee213032623aefb9d40cc0ebb97234e56fa63 Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Fri, 7 Mar 2003 22:11:44 +0000 Subject: - 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. --- modules/comment/comment.module | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'modules/comment/comment.module') 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; } } -- cgit v1.2.3