| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/**
|
| 4 |
* Available variables:
|
| 5 |
* - $forums: An array of forums and containers to display. It is keyed to the
|
| 6 |
* numeric id's of all child forums and containers.
|
| 7 |
* - $forum_id: Forum id for the current forum. Parent to all items within
|
| 8 |
* the $forums array.
|
| 9 |
*
|
| 10 |
* Each $forum in $forums contains:
|
| 11 |
* - $forum->is_container: Is TRUE if the forum can contain other forums. Is
|
| 12 |
* FALSE if the forum can contain only topics.
|
| 13 |
* - $forum->depth: How deep the forum is in the current hierarchy.
|
| 14 |
* - $forum->zebra: 'even' or 'odd' string used for row class.
|
| 15 |
* - $forum->name: The name of the forum.
|
| 16 |
* - $forum->link: The URL to link to this forum.
|
| 17 |
* - $forum->description: The description of this forum.
|
| 18 |
* - $forum->new_topics: True if the forum contains unread posts.
|
| 19 |
* - $forum->new_url: A URL to the forum's unread posts.
|
| 20 |
* - $forum->new_text: Text for the above URL which tells how many new posts.
|
| 21 |
* - $forum->old_topics: A count of posts that have already been read.
|
| 22 |
* - $forum->num_posts: The total number of posts in the forum.
|
| 23 |
* - $forum->last_reply: Text representing the last time a forum was posted or
|
| 24 |
* commented in.
|
| 25 |
*
|
| 26 |
* @see template_preprocess_forum_list()
|
| 27 |
* @see theme_forum_list()
|
| 28 |
*/
|
| 29 |
?>
|
| 30 |
|
| 31 |
<table id="forum-<?php print $forum_id; ?>">
|
| 32 |
<thead>
|
| 33 |
<tr>
|
| 34 |
<th><?php print t('Forum'); ?></th>
|
| 35 |
<th><?php print t('RSS'); ?></th>
|
| 36 |
<th><?php print t('Topics');?></th>
|
| 37 |
<th><?php print t('Posts'); ?></th>
|
| 38 |
<th><?php print t('Last post'); ?></th>
|
| 39 |
</tr>
|
| 40 |
</thead>
|
| 41 |
<tbody>
|
| 42 |
<?php foreach ($forums as $child_id => $forum): ?>
|
| 43 |
<tr id="forum-list-<?php print $child_id; ?>" class="<?php print $forum->zebra; ?>">
|
| 44 |
<td <?php print $forum->is_container ? 'class="container"' : 'class="forum"'; ?>>
|
| 45 |
<?php /* Enclose the contents of this cell with X divs, where X is the
|
| 46 |
* depth this forum resides at. This will allow us to use CSS
|
| 47 |
* left-margin for indenting.
|
| 48 |
*/ ?>
|
| 49 |
<?php print str_repeat('<div class="indent">', $forum->depth); ?>
|
| 50 |
<div class="name"><a href="<?php print $forum->link; ?>"><?php print $forum->name; ?></a></div>
|
| 51 |
<?php if ($forum->description): ?>
|
| 52 |
<div class="description"><?php print $forum->description; ?></div>
|
| 53 |
<?php endif; ?>
|
| 54 |
<?php print str_repeat('</div>', $forum->depth); ?>
|
| 55 |
</td>
|
| 56 |
<td <?php print $forum->is_container ? 'colspan="4" class="container"' : 'class="forum"'; ?>>
|
| 57 |
<a href="/taxonomy/term/<?php print $forum->tid; ?>/0/feed" title="<?php print t('RSS'); ?>"><img src="../misc/feed.png" alt="RSS" /></a>
|
| 58 |
<?php print str_repeat('</div>', $forum->depth); ?>
|
| 59 |
</td>
|
| 60 |
<?php if (!$forum->is_container): ?>
|
| 61 |
<td class="topics">
|
| 62 |
<?php print $forum->num_topics ?>
|
| 63 |
<?php if ($forum->new_topics): ?>
|
| 64 |
<br />
|
| 65 |
<a href="<?php print $forum->new_url; ?>"><?php print $forum->new_text; ?></a>
|
| 66 |
<?php endif; ?>
|
| 67 |
</td>
|
| 68 |
<td class="posts"><?php print $forum->num_posts ?></td>
|
| 69 |
<td class="last-reply"><?php print $forum->last_reply ?></td>
|
| 70 |
<?php endif; ?>
|
| 71 |
</tr>
|
| 72 |
<?php endforeach; ?>
|
| 73 |
</tbody>
|
| 74 |
</table>
|