diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-28 16:44:07 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-28 16:44:07 +0000 |
commit | 2df43894e2f24cb6a39e6cf11a3b39f3c4b70193 (patch) | |
tree | 7290e373de00adc8796333b848e9cd3ca5d4612b /modules/comment/comment.tpl.php | |
parent | cb756bcf08bb5e1288539c06aa16905cda06af9c (diff) | |
download | brdo-2df43894e2f24cb6a39e6cf11a3b39f3c4b70193.tar.gz brdo-2df43894e2f24cb6a39e6cf11a3b39f3c4b70193.tar.bz2 |
#306358 by dvessel, JohnAlbin, and flobruit: Add a single $classes string (and corresponding $classes_array) for all dynamic classes in template files.
Diffstat (limited to 'modules/comment/comment.tpl.php')
-rw-r--r-- | modules/comment/comment.tpl.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index 7d8be3b03..07360a044 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -17,16 +17,33 @@ * comment-unpublished, comment-published or comment-preview. * - $submitted: By line with date and time. * - $title: Linked title. + * - $classes: String of classes that can be used to style contextually through + * CSS. It can be manipulated through the variable $classes_array from + * preprocess functions. The default values can be one or more of the following: + * - comment: The current template type, i.e., "theming hook". + * - comment-by-anonymous: Comment by an unregistered user. + * - comment-by-node-author: Comment by the author of the parent node. + * - comment-preview: When previewing a new or edited comment. + * The following applies only to viewers who are registered users: + * - comment-unpublished: An unpublished comment visible only to administrators. + * - comment-by-viewer: Comment by the user currently viewing the page. + * - comment-new: New comment since last the visit. * - * These two variables are provided for context. + * These two variables are provided for context: * - $comment: Full comment object. * - $node: Node object the comments are attached to. * + * Other variables: + * - $classes_array: Array of html class attribute values. It is flattened + * into a string within the variable $classes. + * + * @see template_preprocess() * @see template_preprocess_comment() + * @see template_process() * @see theme_comment() */ ?> -<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' ' . $status ?> clearfix"> +<div class="<?php print $classes; ?> clearfix"> <?php print $picture ?> <?php if ($comment->new): ?> |