Project

General

Profile

Paste
Download (2.44 KB) Statistics
| Branch: | Revision:

root / drupal7 / modules / forum / forum-topic-list.tpl.php @ db2d93dd

1
<?php
2

    
3
/**
4
 * @file
5
 * Displays a list of forum topics.
6
 *
7
 * Available variables:
8
 * - $header: The table header. This is pre-generated with click-sorting
9
 *   information. If you need to change this, see
10
 *   template_preprocess_forum_topic_list().
11
 * - $pager: The pager to display beneath the table.
12
 * - $topics: An array of topics to be displayed. Each $topic in $topics
13
 *   contains:
14
 *   - $topic->icon: The icon to display.
15
 *   - $topic->moved: A flag to indicate whether the topic has been moved to
16
 *     another forum.
17
 *   - $topic->title: The title of the topic. Safe to output.
18
 *   - $topic->message: If the topic has been moved, this contains an
19
 *     explanation and a link.
20
 *   - $topic->zebra: 'even' or 'odd' string used for row class.
21
 *   - $topic->comment_count: The number of replies on this topic.
22
 *   - $topic->new_replies: A flag to indicate whether there are unread
23
 *     comments.
24
 *   - $topic->new_url: If there are unread replies, this is a link to them.
25
 *   - $topic->new_text: Text containing the translated, properly pluralized
26
 *     count.
27
 *   - $topic->created: A string representing when the topic was posted. Safe
28
 *     to output.
29
 *   - $topic->last_reply: An outputtable string representing when the topic was
30
 *     last replied to.
31
 *   - $topic->timestamp: The raw timestamp this topic was posted.
32
 * - $topic_id: Numeric ID for the current forum topic.
33
 *
34
 * @see template_preprocess_forum_topic_list()
35
 * @see theme_forum_topic_list()
36
 *
37
 * @ingroup themeable
38
 */
39
?>
40
<table id="forum-topic-<?php print $topic_id; ?>">
41
  <thead>
42
    <tr><?php print $header; ?></tr>
43
  </thead>
44
  <tbody>
45
  <?php foreach ($topics as $topic): ?>
46
    <tr class="<?php print $topic->zebra;?>">
47
      <td class="icon"><?php print $topic->icon; ?></td>
48
      <td class="title">
49
        <div>
50
          <?php print $topic->title; ?>
51
        </div>
52
        <div>
53
          <?php print $topic->created; ?>
54
        </div>
55
      </td>
56
    <?php if ($topic->moved): ?>
57
      <td colspan="3"><?php print $topic->message; ?></td>
58
    <?php else: ?>
59
      <td class="replies">
60
        <?php print $topic->comment_count; ?>
61
        <?php if ($topic->new_replies): ?>
62
          <br />
63
          <a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a>
64
        <?php endif; ?>
65
      </td>
66
      <td class="last-reply"><?php print $topic->last_reply; ?></td>
67
    <?php endif; ?>
68
    </tr>
69
  <?php endforeach; ?>
70
  </tbody>
71
</table>
72
<?php print $pager; ?>