Projet

Général

Profil

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

root / drupal7 / sites / all / modules / advanced_forum / styles / naked / advanced-forum.naked.topic-list.tpl.php @ c169e7c4

1
<?php
2

    
3
/**
4
 * @file
5
 * Theme implementation to display 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 template_preprocess_forum_topic_list().
10
 * - $pager: The pager to display beneath the table.
11
 * - $topics: An array of topics to be displayed.
12
 * - $topic_id: Numeric id for the current forum topic.
13
 * - $forum_description: Description of the forum these topics are in.
14
 *
15
 * Each $topic in $topics contains:
16
 * - $topic->icon: The icon to display.
17
 * - $topic->moved: A flag to indicate whether the topic has been moved to
18
 *   another forum.
19
 * - $topic->title: The title of the topic. Safe to output.
20
 * - $topic->message: If the topic has been moved, this contains an
21
 *   explanation and a link.
22
 * - $topic->zebra: 'even' or 'odd' string used for row class.
23
 * - $topic->sticky_class: 'sticky-topic' or 'first-not-sticky' or 'not-sticky'
24
 * - $topic->num_comments: The number of replies on this topic.
25
 * - $topic->new_replies: A flag to indicate whether there are unread comments.
26
 * - $topic->new_url: If there are unread replies, this is a link to them.
27
 * - $topic->new_text: Text containing the translated, properly pluralized count.
28
 * - $topic->created: An outputtable string represented when the topic was posted.
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->new: 1 if this is a new/updated topic for the current user.
33
 *
34
 * @see template_preprocess_forum_topic_list()
35
 * @see advanced_forum_preprocess_forum_topic_list()
36
 */
37
?>
38

    
39
<?php print $pager; ?>
40

    
41
<table id="forum-topic-<?php print $topic_id; ?>" class="forum-table forum-table-topics">
42
  <thead>
43
    <tr><?php print $header; ?></tr>
44
  </thead>
45

    
46
  <tbody>
47
  <?php foreach ($topics as $topic): ?>
48
    <?php
49
    if ($topic->sticky) {
50
      // Extra label on sticky topics
51
      $topic->title = t('Sticky') . ': ' . $topic->title;
52
    }
53
    ?>
54

    
55
    <?php
56
    // Add "new" or "updated" to title where appropriate.
57
    $topic_new = "";
58
    if ($topic->new) {
59
      if ($topic->new_replies > 0) {
60
        $topic_new = ' <span class="marker">' . t('updated') . '</span>';
61
      }
62
      else {
63
        $topic_new = ' <span class="marker">' . t('new') . '</span>';
64
      }
65
    }
66
    ?>
67

    
68
    <tr class="<?php print $topic->zebra;?> <?php print $topic->sticky_class;?>">
69
      <td class="forum-topic-icon"><div class="forum-icon"><?php print $topic->icon; ?></div></td>
70

    
71
      <td class="forum-topic-title">
72
      <?php print $topic->title . $topic_new; ?>
73
      <?php if (!empty($topic->pager)): ?>
74
         <div class="forum-topic-pager"> <?php print $topic->pager ?> </div>
75
      <?php endif; ?>
76
      </td>
77

    
78
      <?php if ($topic->moved): ?>
79
        <td colspan="3">
80
        <?php print $topic->message; ?>
81
        </td>
82
      <?php else: ?>
83
        <td class="forum-replies">
84
          <div class="forum-number-replies"><?php print $topic->num_comments; ?></div>
85
          <?php if ($topic->new_replies): ?>
86
            <div class="forum-number-new-replies"><a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a></div>
87
          <?php endif; ?>
88
        </td>
89

    
90
      <?php if (module_exists('statistics')): ?>
91
        <td class="forum-number-views"><?php print $topic->views;?> </td>
92
      <?php endif; ?>
93

    
94
      <?php if (!variable_get('advanced_forum_hide_created', 0)): ?>
95
        <td class="forum-topic-created"><?php print $topic->created; ?></td>
96
      <?php endif; ?>
97

    
98
      <td class="forum-last-reply"><?php print $topic->last_reply; ?></td>
99
    <?php endif; ?>
100
    </tr>
101
  <?php endforeach; ?>
102
  </tbody>
103
</table>
104
<?php print $pager; ?>