Projet

Général

Profil

Paste
Télécharger (3,73 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / mayo / templates / comment.tpl.php @ f066bdb5

1
<?php
2

    
3
/**
4
 * @file
5
 * Default theme implementation for comments.
6
 *
7
 * Available variables:
8
 * - $author: Comment author. Can be link or plain text.
9
 * - $content: An array of comment items. Use render($content) to print them all, or
10
 *   print a subset such as render($content['field_example']). Use
11
 *   hide($content['field_example']) to temporarily suppress the printing of a
12
 *   given element.
13
 * - $created: Formatted date and time for when the comment was created.
14
 *   Preprocess functions can reformat it by calling format_date() with the
15
 *   desired parameters on the $comment->created variable.
16
 * - $changed: Formatted date and time for when the comment was last changed.
17
 *   Preprocess functions can reformat it by calling format_date() with the
18
 *   desired parameters on the $comment->changed variable.
19
 * - $new: New comment marker.
20
 * - $permalink: Comment permalink.
21
 * - $picture: Authors picture.
22
 * - $signature: Authors signature.
23
 * - $status: Comment status. Possible values are:
24
 *   comment-unpublished, comment-published or comment-preview.
25
 * - $title: Linked title.
26
 * - $classes: String of classes that can be used to style contextually through
27
 *   CSS. It can be manipulated through the variable $classes_array from
28
 *   preprocess functions. The default values can be one or more of the following:
29
 *   - comment: The current template type, i.e., "theming hook".
30
 *   - comment-by-anonymous: Comment by an unregistered user.
31
 *   - comment-by-node-author: Comment by the author of the parent node.
32
 *   - comment-preview: When previewing a new or edited comment.
33
 *   The following applies only to viewers who are registered users:
34
 *   - comment-unpublished: An unpublished comment visible only to administrators.
35
 *   - comment-by-viewer: Comment by the user currently viewing the page.
36
 *   - comment-new: New comment since last the visit.
37
 * - $title_prefix (array): An array containing additional output populated by
38
 *   modules, intended to be displayed in front of the main title tag that
39
 *   appears in the template.
40
 * - $title_suffix (array): An array containing additional output populated by
41
 *   modules, intended to be displayed after the main title tag that appears in
42
 *   the template.
43
 *
44
 * These two variables are provided for context:
45
 * - $comment: Full comment object.
46
 * - $node: Node object the comments are attached to.
47
 *
48
 * Other variables:
49
 * - $classes_array: Array of html class attribute values. It is flattened
50
 *   into a string within the variable $classes.
51
 *
52
 * @see template_preprocess()
53
 * @see template_preprocess_comment()
54
 * @see template_process()
55
 * @see theme_comment()
56
 */
57
?>
58
<?php
59
  $spam = 0;
60
  if (function_exists('antispam_content_is_spam')) {
61
    if (antispam_content_is_spam('comment', $comment->cid)) {
62
      $spam = 1;
63
    }
64
  }
65
?>
66
<div class="<?php print $classes; ?><?php if ($spam) print " comment-spam"; ?> clearfix"<?php print $attributes; ?>>
67
  <?php print $picture ?>
68

    
69
  <?php if ($new): ?>
70
    <span class="new"><?php print $new ?></span>
71
  <?php endif; ?>
72

    
73
  <?php print render($title_prefix); ?>
74
  <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
75
  <?php print render($title_suffix); ?>
76

    
77
  <div class="submitted">
78
    <?php print $permalink; ?>
79
    <?php
80
      print t('Submitted by !username on !datetime.',
81
        array('!username' => $author, '!datetime' => $created));
82
    ?>
83
  </div>
84

    
85
  <div class="content"<?php print $content_attributes; ?>>
86
    <?php
87
      // We hide the comments and links now so that we can render them later.
88
      hide($content['links']);
89
      print render($content);
90
    ?>
91
    <?php if ($signature): ?>
92
    <div class="user-signature clearfix">
93
      <?php print $signature ?>
94
    </div>
95
    <?php endif; ?>
96
  </div>
97

    
98
  <?php print render($content['links']) ?>
99
</div>