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