Code coverage for /20081101/modules/forum/forum-list.tpl.php

Line #Times calledCode
1
<?php
2
// $Id: forum-list.tpl.php,v 1.5 2008/10/13 12:31:42 dries Exp $
3
4
/**
5
 * @file
6
 * Default theme implementation to display a list of forums and containers.
7
 *
8
 * Available variables:
9
 * - $forums: An array of forums and containers to display. It is keyed to
the
10
 *   numeric id's of all child forums and containers.
11
 * - $forum_id: Forum id for the current forum. Parent to all items within
12
 *   the $forums array.
13
 *
14
 * Each $forum in $forums contains:
15
 * - $forum->is_container: Is TRUE if the forum can contain other forums.
Is
16
 *   FALSE if the forum can contain only topics.
17
 * - $forum->depth: How deep the forum is in the current hierarchy.
18
 * - $forum->zebra: 'even' or 'odd' string used for row class.
19
 * - $forum->name: The name of the forum.
20
 * - $forum->link: The URL to link to this forum.
21
 * - $forum->description: The description of this forum.
22
 * - $forum->new_topics: True if the forum contains unread posts.
23
 * - $forum->new_url: A URL to the forum's unread posts.
24
 * - $forum->new_text: Text for the above URL which tells how many new
posts.
25
 * - $forum->old_topics: A count of posts that have already been read.
26
 * - $forum->num_posts: The total number of posts in the forum.
27
 * - $forum->last_reply: Text representing the last time a forum was posted
or
28
 *   commented in.
29
 *
30
 * @see template_preprocess_forum_list()
31
 * @see theme_forum_list()
32
 */
33
?>
344
<table id="forum-<?php print $forum_id; ?>">
35
  <thead>
36
    <tr>
374
      <th><?php print t('Forum'); ?></th>
384
      <th><?php print t('Topics');?></th>
394
      <th><?php print t('Posts'); ?></th>
404
      <th><?php print t('Last post'); ?></th>
41
    </tr>
42
  </thead>
43
  <tbody>
444
  <?php foreach ($forums as $child_id => $forum): ?>
454
    <tr id="forum-list-<?php print $child_id; ?>" class="<?php print
$forum->zebra; ?>">
464
      <td <?php print $forum->is_container ? 'colspan="4"
class="container"' : 'class="forum"'; ?>>
474
        <?php /* Enclose the contents of this cell with X divs, where X is
the
48
               * depth this forum resides at. This will allow us to use CSS
49
               * left-margin for indenting.
50
               */ ?>
514
        <?php print str_repeat('<div class="indent">', $forum->depth); ?>
524
          <div class="name"><a href="<?php print $forum->link; ?>"><?php
print $forum->name; ?></a></div>
534
          <?php if ($forum->description): ?>
544
            <div class="description"><?php print $forum->description;
?></div>
554
          <?php endif; ?>
564
        <?php print str_repeat('</div>', $forum->depth); ?>
57
      </td>
584
      <?php if (!$forum->is_container): ?>
59
        <td class="topics">
604
          <?php print $forum->num_topics ?>
614
          <?php if ($forum->new_topics): ?>
62
            <br />
634
            <a href="<?php print $forum->new_url; ?>"><?php print
$forum->new_text; ?></a>
644
          <?php endif; ?>
65
        </td>
664
        <td class="posts"><?php print $forum->num_posts ?></td>
674
        <td class="last-reply"><?php print $forum->last_reply ?></td>
684
      <?php endif; ?>
69
    </tr>
704
  <?php endforeach; ?>
71
  </tbody>
72
</table>
734