Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.364 diff -u -r1.364 comment.module --- modules/comment.module 1 Aug 2005 05:14:05 -0000 1.364 +++ modules/comment.module 5 Aug 2005 05:19:14 -0000 @@ -434,7 +434,10 @@ function comment_validate($edit) { global $user; - + + // Invoke other validation handlers + module_invoke_all('comment', 'validate', $edit); + // only admins can change these fields if (!user_access('administer comments')) { $edit['uid'] = $user->uid; @@ -1414,6 +1417,9 @@ $form .= form_textfield(t('Homepage'), 'homepage', $edit['homepage'], 30, 255); } + // Invoke other forms + $form .= implode('', module_invoke_all('comment', 'form_pre', $edit)); + if (variable_get('comment_subject_field', 1)) { $form .= form_textfield(t('Subject'), 'subject', $edit['subject'], 60, 64); } @@ -1421,6 +1427,10 @@ $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 60, 15, '', NULL, TRUE); $form .= filter_form('format', $edit['format']); + + // Invoke other forms + $form .= implode('', module_invoke_all('comment', 'form_post', $edit)); + $form .= form_hidden('cid', $edit['cid']); $form .= form_hidden('pid', $edit['pid']); $form .= form_hidden('nid', $edit['nid']); @@ -1459,6 +1469,10 @@ // Switch to folded/unfolded view of the comment if ($visible) { $comment->comment = check_markup($comment->comment, $comment->format, FALSE); + + // Comment API hook + $comment->comment .= implode('', module_invoke_all('comment', 'view', $comment)); + $output .= theme('comment', $comment, $links); } else { @@ -1685,4 +1699,4 @@ db_query("UPDATE {node_comment_statistics} SET comment_count = %d, last_comment_timestamp = %d, last_comment_name = '%s', last_comment_uid = %d WHERE nid = %d", 0, NULL, 0, 0, $nid); } } -?> +?> \ No newline at end of file