diff options
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 7 | ||||
-rw-r--r-- | modules/comment/comment.tpl.php | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 2c2330d1a..4c00cf191 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1680,6 +1680,13 @@ function template_preprocess_comment(&$variables) { $variables['submitted'] = theme('comment_submitted', $comment); $variables['title'] = l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")); $variables['template_files'][] = 'comment-'. $node->type; + // set status to a string representation of comment->status. + if (isset($comment->preview)) { + $variables['status'] = 'comment-preview'; + } + else { + $variables['status'] = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'comment-unpublished' : 'comment-published'; + } } /** diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index 0a5f9579b..68cc55268 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -13,6 +13,8 @@ * - $new: New comment marker. * - $picture: Authors picture. * - $signature: Authors signature. + * - $status: Comment status. Possible values are: + * comment-unpublished, comment-published or comment-review. * - $submitted: By line with date and time. * - $title: Linked title. * @@ -24,7 +26,7 @@ * @see theme_comment() */ ?> -<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?> clear-block"> +<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status ?> clear-block"> <?php print $picture ?> <?php if ($comment->new): ?> |