diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2003-02-16 14:57:35 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2003-02-16 14:57:35 +0000 |
commit | dd329e1d95dcc0e02841482b660091945f433d13 (patch) | |
tree | 4ab177a5825704acd68741389f8659718646e2b0 /modules/comment.module | |
parent | b29f1bff7fa95270644d4d4db42bbe3d92cbb0d6 (diff) | |
download | brdo-dd329e1d95dcc0e02841482b660091945f433d13.tar.gz brdo-dd329e1d95dcc0e02841482b660091945f433d13.tar.bz2 |
- Added function node_invoke_all($hook, &$node, $op, $arg = 0).
- Added a _nodeapi hook that in time will replace the _node hook. Trying
to make as few changes to existing code as possible until the new api
is stabilized.
- Modified node_form() to add administration options from other modules
using the _nodeapi hook.
- Modified node_save() to fetch which fields should be saved to the node
table from the _nodeapi hook.
- Moved comment and queue options from node_form() and node_save() to
the modules _nodeapi hooks.
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/comment.module b/modules/comment.module index effac37d1..e9fde950c 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1490,4 +1490,16 @@ function comment_update_index() { return array("last_update" => "comment_cron_last", "node_type" => "comment", "select" => "SELECT c.cid as lno, c.subject as text1, c.comment as text2 FROM comments c WHERE c.status = 0 AND timestamp > ". variable_get("comment_cron_last", 1)); } -?> +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 "fields": + return array("comment"); + } +} + +?>
\ No newline at end of file |