#1067330 by JohnAlbin: Update phpdoc block in comment.tpl
[project/zen.git] / templates / comment.tpl.php
1 <?php
2 /**
3 * @file
4 * Zen theme's implementation for comments.
5 *
6 * Available variables:
7 * - $author: Comment author. Can be link or plain text.
8 * - $content: An array of comment items. Use render($content) to print them all, or
9 * print a subset such as render($content['field_example']). Use
10 * hide($content['field_example']) to temporarily suppress the printing of a
11 * given element.
12 * - $created: Formatted date and time for when the comment was created.
13 * Preprocess functions can reformat it by calling format_date() with the
14 * desired parameters on the $comment->created variable.
15 * - $changed: Formatted date and time for when the comment was last changed.
16 * Preprocess functions can reformat it by calling format_date() with the
17 * desired parameters on the $comment->changed variable.
18 * - $new: New comment marker.
19 * - $permalink: Comment permalink.
20 * - $submitted: Submission information created from $author and $created during
21 * template_preprocess_comment().
22 * - $picture: Authors picture.
23 * - $signature: Authors signature.
24 * - $status: Comment status. Possible values are:
25 * comment-unpublished, comment-published or comment-preview.
26 * - $title: Linked title.
27 * - $classes: String of classes that can be used to style contextually through
28 * CSS. It can be manipulated through the variable $classes_array from
29 * preprocess functions. The default values can be one or more of the following:
30 * - comment: The current template type, i.e., "theming hook".
31 * - comment-by-anonymous: Comment by an unregistered user.
32 * - comment-by-node-author: Comment by the author of the parent node.
33 * - comment-preview: When previewing a new or edited comment.
34 * - first: The first comment in the list of displayed comments.
35 * - last: The last comment in the list of displayed comments.
36 * - odd: An odd-numbered comment in the list of displayed comments.
37 * - even: An even-numbered comment in the list of displayed comments.
38 * The following applies only to viewers who are registered users:
39 * - comment-unpublished: An unpublished comment visible only to administrators.
40 * - comment-by-viewer: Comment by the user currently viewing the page.
41 * - comment-new: New comment since the last visit.
42 * - $title_prefix (array): An array containing additional output populated by
43 * modules, intended to be displayed in front of the main title tag that
44 * appears in the template.
45 * - $title_suffix (array): An array containing additional output populated by
46 * modules, intended to be displayed after the main title tag that appears in
47 * the template.
48 *
49 * These two variables are provided for context:
50 * - $comment: Full comment object.
51 * - $node: Node object the comments are attached to.
52 *
53 * Other variables:
54 * - $classes_array: Array of html class attribute values. It is flattened
55 * into a string within the variable $classes.
56 *
57 * @see template_preprocess()
58 * @see template_preprocess_comment()
59 * @see zen_preprocess_comment()
60 * @see template_process()
61 * @see theme_comment()
62 */
63 ?>
64 <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
65 <?php print $picture; ?>
66
67 <?php print render($title_prefix); ?>
68 <?php if ($title): ?>
69 <h3<?php print $title_attributes; ?>>
70 <?php print $title; ?>
71 <?php if ($new): ?>
72 <span class="new"><?php print $new; ?></span>
73 <?php endif; ?>
74 </h3>
75 <?php elseif ($new): ?>
76 <div class="new"><?php print $new; ?></div>
77 <?php endif; ?>
78 <?php print render($title_suffix); ?>
79
80 <?php if ($status == 'comment-unpublished'): ?>
81 <div class="unpublished"><?php print t('Unpublished'); ?></div>
82 <?php endif; ?>
83
84 <div class="submitted">
85 <?php print $permalink; ?>
86 <?php print $submitted; ?>
87 </div>
88
89 <div class="content"<?php print $content_attributes; ?>>
90 <?php
91 // We hide the comments and links now so that we can render them later.
92 hide($content['links']);
93 print render($content);
94 ?>
95 <?php if ($signature): ?>
96 <div class="user-signature clearfix">
97 <?php print $signature; ?>
98 </div>
99 <?php endif; ?>
100 </div>
101
102 <?php print render($content['links']) ?>
103 </div><!-- /.comment -->