diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-05-22 21:14:59 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-05-22 21:14:59 +0000 |
commit | 21274fbb94917593e784f8e1fffbea1ea2784e3c (patch) | |
tree | 555d60ab7538df2edcacfa2e76f9bba4806cf8fa /modules | |
parent | 2abaae6bafb6d67fcb18bcecd1e0e1d2fe50c0d6 (diff) | |
download | brdo-21274fbb94917593e784f8e1fffbea1ea2784e3c.tar.gz brdo-21274fbb94917593e784f8e1fffbea1ea2784e3c.tar.bz2 |
- #23285: Allow theming of comment previews, like node previews.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment.module | 14 | ||||
-rw-r--r-- | modules/comment/comment.module | 14 |
2 files changed, 18 insertions, 10 deletions
diff --git a/modules/comment.module b/modules/comment.module index a53535eb1..ab895ac33 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -493,10 +493,7 @@ function comment_preview($edit) { $output = ''; - $comment = new StdClass(); - foreach ($edit as $key => $value) { - $comment->$key = $value; - } + $comment = array2object($edit); // Attach the user and time information. $comment->uid = $user->uid; @@ -504,7 +501,7 @@ function comment_preview($edit) { $comment->name = check_plain($user->name ? $user->name : $comment->name); // Preview the comment. - $output .= theme('comment_view', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1))); + $output .= theme('comment_preview', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1))); $output .= theme('comment_form', $edit, t('Reply')); if ($edit['pid']) { @@ -1431,6 +1428,13 @@ function theme_comment_form($edit, $title) { return theme('box', $title, form($form, 'post', url('comment/reply/'. $edit['nid']))); } +function theme_comment_preview($comment, $links = '', $visible = 1) { + $output = '<div class="preview">'; + $output .= theme('comment_view', $comment, $links, $visible); + $output .= '</div>'; + return $output; +}; + function theme_comment_view($comment, $links = '', $visible = 1) { // Emit selectors: diff --git a/modules/comment/comment.module b/modules/comment/comment.module index a53535eb1..ab895ac33 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -493,10 +493,7 @@ function comment_preview($edit) { $output = ''; - $comment = new StdClass(); - foreach ($edit as $key => $value) { - $comment->$key = $value; - } + $comment = array2object($edit); // Attach the user and time information. $comment->uid = $user->uid; @@ -504,7 +501,7 @@ function comment_preview($edit) { $comment->name = check_plain($user->name ? $user->name : $comment->name); // Preview the comment. - $output .= theme('comment_view', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1))); + $output .= theme('comment_preview', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1))); $output .= theme('comment_form', $edit, t('Reply')); if ($edit['pid']) { @@ -1431,6 +1428,13 @@ function theme_comment_form($edit, $title) { return theme('box', $title, form($form, 'post', url('comment/reply/'. $edit['nid']))); } +function theme_comment_preview($comment, $links = '', $visible = 1) { + $output = '<div class="preview">'; + $output .= theme('comment_view', $comment, $links, $visible); + $output .= '</div>'; + return $output; +}; + function theme_comment_view($comment, $links = '', $visible = 1) { // Emit selectors: |