Commit 258b5760 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#199809 by theborg: comment templates were not checking status properly (fix...

#199809 by theborg: comment templates were not checking status properly (fix notice, allows themes to theme in-preview comments differently)
parent b5e64f5a
......@@ -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';
}
}
/**
......
......@@ -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): ?>
......
<?php
// $Id$
?>
<div class="comment<?php if (isset($comment->status) && $comment->status == COMMENT_NOT_PUBLISHED) print ' comment-unpublished'; ?>">
<div class="comment<?php print ' '. $status; ?>">
<?php if ($picture) {
print $picture;
} ?>
......
......@@ -157,7 +157,7 @@ function chameleon_comment($comment, $node, $links = array()) {
'title' => t('By !author at @date', array('!author' => theme('username', $comment), '@date' => format_date($comment->timestamp, 'small'))),
'html' => TRUE);
$output = "<div class=\"comment". ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') ."\">\n";
$output = "<div class=\"comment". ' '. $status ."\">\n";
$output .= " <h3 class=\"title\">". l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid")) ."</h3>\n";
$output .= " <div class=\"content\">". $comment->comment;
if (!empty($signature)) {
......
<?php
// $Id$
?>
<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print (isset($comment->status) && $comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; print ' '. $zebra; ?>">
<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status; print ' '. $zebra; ?>">
<div class="clear-block">
<?php if ($submitted): ?>
......
<?php
// $Id$
?>
<div class="comment<?php if ($comment->status == COMMENT_NOT_PUBLISHED) print ' comment-unpublished'; ?>">
<div class="comment<?php print ' '. $status; ?>">
<?php if ($picture) : ?>
<?php print $picture ?>
<?php endif; ?>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment