Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.347.2.6 diff -u -r1.347.2.6 comment.module --- modules/comment.module 25 Jul 2005 09:41:20 -0000 1.347.2.6 +++ modules/comment.module 2 Sep 2005 01:30:50 -0000 @@ -482,6 +482,9 @@ } } + // Invoke other validation handlers + module_invoke_all('comment', 'validate', $edit); + return $edit; } @@ -1404,10 +1407,16 @@ if (variable_get('comment_subject_field', 1)) { $form .= form_textfield(t('Subject'), 'subject', $edit['subject'], 50, 64); } + + // Invoke other form handlers + $form .= implode('', module_invoke_all('comment', 'form pre', $edit)); // comment field: $form .= form_textarea(t('Comment'), 'comment', $edit['comment'] ? $edit['comment'] : $user->signature, 70, 10, '', NULL, TRUE); + // Invoke other form handlers + $form .= implode('', module_invoke_all('comment', 'form post', $edit)); + // format selector $form .= filter_form('format', $edit['format']); @@ -1424,8 +1433,13 @@ if (!variable_get('comment_preview', 1) || ($_POST['op'] == t('Preview comment')) || ($_POST['op'] == t('Post comment'))) { $form .= form_submit(t('Post comment')); } - - return theme('box', $title, form($form, 'post', url('comment/reply/'. $edit['nid']))); + $extra = module_invoke_all('comment', 'form param', $edit); + $attributes = array('id' => 'comment-form'); + if (is_array($extra)) { + $attributes = array_merge($extra, $attributes); + } + + return theme('box', $title, form($form, 'post', url('comment/reply/'. $edit['nid']), $attributes)); } function theme_comment_preview($comment, $links = '', $visible = 1) { @@ -1448,6 +1462,7 @@ // Switch to folded/unfolded view of the comment if ($visible) { $comment->comment = check_output($comment->comment, $comment->format); + $comment->comment .= implode('', module_invoke_all('comment', 'view', $comment)); $output .= theme('comment', $comment, $links); } else { @@ -1675,4 +1690,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