2007-07-20 08:51:13 +00:00
|
|
|
<?php
|
2007-08-07 08:39:36 +00:00
|
|
|
|
2007-07-20 08:51:13 +00:00
|
|
|
/**
|
2008-05-14 13:12:41 +00:00
|
|
|
* @file
|
2007-07-20 08:51:13 +00:00
|
|
|
* Default theme implementation for comments.
|
|
|
|
*
|
|
|
|
* Available variables:
|
|
|
|
* - $author: Comment author. Can be link or plain text.
|
2012-01-03 04:36:15 +00:00
|
|
|
* - $content: An array of comment items. Use render($content) to print them
|
|
|
|
* all, or print a subset such as render($content['field_example']). Use
|
2009-07-28 10:09:25 +00:00
|
|
|
* hide($content['field_example']) to temporarily suppress the printing of a
|
|
|
|
* given element.
|
2009-10-19 20:33:21 +00:00
|
|
|
* - $created: Formatted date and time for when the comment was created.
|
|
|
|
* Preprocess functions can reformat it by calling format_date() with the
|
|
|
|
* desired parameters on the $comment->created variable.
|
|
|
|
* - $changed: Formatted date and time for when the comment was last changed.
|
|
|
|
* Preprocess functions can reformat it by calling format_date() with the
|
|
|
|
* desired parameters on the $comment->changed variable.
|
2007-07-20 08:51:13 +00:00
|
|
|
* - $new: New comment marker.
|
2010-01-07 05:23:52 +00:00
|
|
|
* - $permalink: Comment permalink.
|
2010-12-01 00:18:15 +00:00
|
|
|
* - $submitted: Submission information created from $author and $created during
|
|
|
|
* template_preprocess_comment().
|
2011-12-05 12:06:35 +00:00
|
|
|
* - $user_picture: The comment author's picture from user-picture.tpl.php.
|
2007-07-20 08:51:13 +00:00
|
|
|
* - $signature: Authors signature.
|
2008-01-04 19:24:24 +00:00
|
|
|
* - $status: Comment status. Possible values are:
|
2012-03-11 12:21:59 +00:00
|
|
|
* unpublished, published, or preview.
|
2007-07-20 08:51:13 +00:00
|
|
|
* - $title: Linked title.
|
2012-08-03 15:31:18 +00:00
|
|
|
* - $attributes: An instance of Attributes class that can be manipulated as an
|
|
|
|
* array and printed as a string.
|
|
|
|
* It includes the 'class' information, which includes:
|
2012-03-11 12:21:59 +00:00
|
|
|
* - comment: The current template type; e.g., 'theming hook'.
|
|
|
|
* - by-anonymous: Comment by an unregistered user.
|
|
|
|
* - by-node-author: Comment by the author of the parent node.
|
|
|
|
* - preview: When previewing a new or edited comment.
|
2009-05-28 16:44:07 +00:00
|
|
|
* The following applies only to viewers who are registered users:
|
2012-03-11 12:21:59 +00:00
|
|
|
* - unpublished: An unpublished comment visible only to administrators.
|
|
|
|
* - by-viewer: Comment by the user currently viewing the page.
|
|
|
|
* - new: New comment since the last visit.
|
2010-01-04 03:57:19 +00:00
|
|
|
* - $title_prefix (array): An array containing additional output populated by
|
|
|
|
* modules, intended to be displayed in front of the main title tag that
|
|
|
|
* appears in the template.
|
|
|
|
* - $title_suffix (array): An array containing additional output populated by
|
|
|
|
* modules, intended to be displayed after the main title tag that appears in
|
|
|
|
* the template.
|
2007-07-20 08:51:13 +00:00
|
|
|
*
|
2009-05-28 16:44:07 +00:00
|
|
|
* These two variables are provided for context:
|
2007-07-20 08:51:13 +00:00
|
|
|
* - $comment: Full comment object.
|
2012-04-26 16:44:37 +00:00
|
|
|
* - $node: Node entity the comments are attached to.
|
2007-07-20 08:51:13 +00:00
|
|
|
*
|
2009-05-28 16:44:07 +00:00
|
|
|
* @see template_preprocess()
|
2007-07-20 08:51:13 +00:00
|
|
|
* @see template_preprocess_comment()
|
2009-05-28 16:44:07 +00:00
|
|
|
* @see template_process()
|
2007-07-20 08:51:13 +00:00
|
|
|
* @see theme_comment()
|
|
|
|
*/
|
|
|
|
?>
|
2012-08-03 15:31:18 +00:00
|
|
|
<article class="<?php print $attributes['class']; ?> clearfix"<?php print $attributes; ?>>
|
2007-04-27 07:42:54 +00:00
|
|
|
|
2011-12-05 12:06:35 +00:00
|
|
|
<?php print render($title_prefix); ?>
|
2009-07-28 10:09:25 +00:00
|
|
|
<?php if ($new): ?>
|
2011-12-05 12:06:35 +00:00
|
|
|
<mark class="new"><?php print $new; ?></mark>
|
2007-07-20 08:51:13 +00:00
|
|
|
<?php endif; ?>
|
2011-12-05 12:06:35 +00:00
|
|
|
<h3<?php print $title_attributes; ?>><?php print $title; ?></h3>
|
2010-01-04 03:57:19 +00:00
|
|
|
<?php print render($title_suffix); ?>
|
2007-04-27 07:42:54 +00:00
|
|
|
|
2011-12-05 12:06:35 +00:00
|
|
|
<footer>
|
|
|
|
<?php print $user_picture; ?>
|
|
|
|
<p class="submitted"><?php print $submitted; ?></p>
|
2010-01-07 05:23:52 +00:00
|
|
|
<?php print $permalink; ?>
|
2011-12-05 12:06:35 +00:00
|
|
|
</footer>
|
2007-04-27 07:42:54 +00:00
|
|
|
|
2009-10-19 01:30:07 +00:00
|
|
|
<div class="content"<?php print $content_attributes; ?>>
|
2009-07-28 10:09:25 +00:00
|
|
|
<?php
|
2011-12-05 12:06:35 +00:00
|
|
|
// We hide the links now so that we can render them later.
|
2009-07-28 10:09:25 +00:00
|
|
|
hide($content['links']);
|
|
|
|
print render($content);
|
|
|
|
?>
|
2007-04-27 07:42:54 +00:00
|
|
|
<?php if ($signature): ?>
|
2011-12-05 12:06:35 +00:00
|
|
|
<div class="user-signature">
|
|
|
|
<?php print $signature; ?>
|
2007-04-27 07:42:54 +00:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
2009-07-28 10:09:25 +00:00
|
|
|
<?php print render($content['links']) ?>
|
2011-12-05 12:06:35 +00:00
|
|
|
</article>
|