root / drupal7 / sites / all / themes / adaptivetheme / at_core / templates / comment.tpl.php @ 74f6bef0
1 | 85ad3d82 | Assos Assos | <?php
|
---|---|---|---|
2 | /**
|
||
3 | * @file
|
||
4 | * Adaptivetheme implementation for the display of a single comment.
|
||
5 | *
|
||
6 | * Adaptivetheme variables:
|
||
7 | * AT Core sets special time and date variables for use in templates:
|
||
8 | * - $submitted: Submission information created from $name and $date during
|
||
9 | * adaptivetheme_preprocess_comment(), uses the $created variable.
|
||
10 | * - $created: Formatted date and time for when the comment was created wrapped
|
||
11 | * in a permalink, uses the $datetime variable.
|
||
12 | * - $datetime: datetime stamp formatted correctly to ISO8601.
|
||
13 | * - $header_attributes: attributes such as classes to apply to the header element.
|
||
14 | * - $footer_attributes: attributes such as classes to apply to the footer element.
|
||
15 | * - $links_attributes: attributes such as classes to apply to the nav element.
|
||
16 | 74f6bef0 | Assos Assos | * - $is_mobile: Mixed, requires the Mobile Detect or Browscap module to return
|
17 | * TRUE for mobile. Note that tablets are also considered mobile devices.
|
||
18 | * Returns NULL if the feature could not be detected.
|
||
19 | * - $is_tablet: Mixed, requires the Mobile Detect to return TRUE for tablets.
|
||
20 | * Returns NULL if the feature could not be detected.
|
||
21 | 85ad3d82 | Assos Assos | *
|
22 | * Available variables:
|
||
23 | * - $author: Comment author. Can be link or plain text.
|
||
24 | * - $content: An array of comment items. Use render($content) to print them all, or
|
||
25 | * print a subset such as render($content['field_example']). Use
|
||
26 | * hide($content['field_example']) to temporarily suppress the printing of a
|
||
27 | * given element.
|
||
28 | * Preprocess functions can reformat it by calling format_date() with the
|
||
29 | * desired parameters on the $comment->created variable.
|
||
30 | * - $changed: Formatted date and time for when the comment was last changed.
|
||
31 | * Preprocess functions can reformat it by calling format_date() with the
|
||
32 | * desired parameters on the $comment->changed variable.
|
||
33 | * - $new: New comment marker.
|
||
34 | * - $permalink: Comment permalink.
|
||
35 | * - $picture: Authors picture.
|
||
36 | * - $signature: Authors signature.
|
||
37 | * - $status: Comment status. Possible values are:
|
||
38 | * comment-unpublished, comment-published or comment-preview.
|
||
39 | * - $title: Linked title.
|
||
40 | * - $classes: String of classes that can be used to style contextually through
|
||
41 | * CSS. It can be manipulated through the variable $classes_array from
|
||
42 | * preprocess functions. The default values can be one or more of the following:
|
||
43 | * - comment: The current template type, i.e., "theming hook".
|
||
44 | * - comment-by-anonymous: Comment by an unregistered user.
|
||
45 | * - comment-by-node-author: Comment by the author of the parent node.
|
||
46 | * - comment-preview: When previewing a new or edited comment.
|
||
47 | * The following applies only to viewers who are registered users:
|
||
48 | * - comment-unpublished: An unpublished comment visible only to administrators.
|
||
49 | * - comment-by-viewer: Comment by the user currently viewing the page.
|
||
50 | * - comment-new: New comment since last the visit.
|
||
51 | * - $title_prefix (array): An array containing additional output populated by
|
||
52 | * modules, intended to be displayed in front of the main title tag that
|
||
53 | * appears in the template.
|
||
54 | * - $title_suffix (array): An array containing additional output populated by
|
||
55 | * modules, intended to be displayed after the main title tag that appears in
|
||
56 | * the template.
|
||
57 | *
|
||
58 | * These two variables are provided for context:
|
||
59 | * - $comment: Full comment object.
|
||
60 | * - $node: Node object the comments are attached to.
|
||
61 | *
|
||
62 | * Other variables:
|
||
63 | * - $classes_array: Array of html class attribute values. It is flattened
|
||
64 | * into a string within the variable $classes.
|
||
65 | *
|
||
66 | * @see template_preprocess()
|
||
67 | * @see template_preprocess_comment()
|
||
68 | * @see template_process()
|
||
69 | * @see theme_comment()
|
||
70 | * @see adaptivetheme_preprocess_comment()
|
||
71 | * @see adaptivetheme_process_comment()
|
||
72 | *
|
||
73 | * Hiding Content and Printing it Separately:
|
||
74 | * Use the hide() function to hide fields and other content, you can render it
|
||
75 | * later using the render() function. Install the Devel module and use
|
||
76 | * <?php print dsm($content); ?> to find variable names to hide() or render().
|
||
77 | */
|
||
78 | |||
79 | hide($content['links']); |
||
80 | ?>
|
||
81 | <article class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>> |
||
82 | <?php print render($title_prefix); ?> |
||
83 | |||
84 | <?php if ($title || $new): ?> |
||
85 | <header<?php print $header_attributes; ?>> |
||
86 | <?php if ($title): ?> |
||
87 | <h3<?php print $title_attributes; ?>><?php print $title ?></h3> |
||
88 | <?php endif; ?> |
||
89 | <?php if ($new): ?> |
||
90 | <em class="new"><?php print $new ?></em> |
||
91 | <?php endif; ?> |
||
92 | </header>
|
||
93 | <?php endif; ?> |
||
94 | |||
95 | <?php if ($picture || $submitted): ?> |
||
96 | <footer<?php print $footer_attributes; ?>> |
||
97 | <?php print $picture; ?> |
||
98 | <p class="author-datetime"><?php print $submitted; ?></p> |
||
99 | </footer>
|
||
100 | <?php endif; ?> |
||
101 | |||
102 | <div<?php print $content_attributes; ?>> |
||
103 | <?php print render($content); ?> |
||
104 | </div>
|
||
105 | |||
106 | <?php if ($signature): ?> |
||
107 | <div class="user-signature"><?php print $signature ?></div> |
||
108 | <?php endif; ?> |
||
109 | |||
110 | <?php if ($links = render($content['links'])): ?> |
||
111 | <nav<?php print $links_attributes; ?>><?php print $links; ?></nav> |
||
112 | <?php endif; ?> |
||
113 | |||
114 | <?php print render($title_suffix); ?> |
||
115 | </article> |