diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-08-03 06:07:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-08-03 06:07:52 +0000 |
commit | 3488a1ed443c92f918e6153c27fd6d6cf3ab287d (patch) | |
tree | 3104eece814fcc37232e56ab2ad9570f847341f8 /modules/forum/forum-list.tpl.php | |
parent | f1d2f5a18d1c14a44f1fdcfef0e72116bb527784 (diff) | |
download | brdo-3488a1ed443c92f918e6153c27fd6d6cf3ab287d.tar.gz brdo-3488a1ed443c92f918e6153c27fd6d6cf3ab287d.tar.bz2 |
- Patch #158536 by dvessel: more forum template massaging.
Diffstat (limited to 'modules/forum/forum-list.tpl.php')
-rw-r--r-- | modules/forum/forum-list.tpl.php | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/modules/forum/forum-list.tpl.php b/modules/forum/forum-list.tpl.php index 70cf597a2..27419f838 100644 --- a/modules/forum/forum-list.tpl.php +++ b/modules/forum/forum-list.tpl.php @@ -2,15 +2,16 @@ // $Id /** * @file forum-list.tpl.php - * Default theme implementation to display a list of forums. + * Default theme implementation to display a list of forums and containers. * * Available variables: - * - $forums: An array of forums to display. + * - $forums: An array of forums and containers to display. * * Each $forum in $forums contains: * - $forum->is_container: Is TRUE if the forum can contain other forums. Is * FALSE if the forum can contain only topics. * - $forum->depth: How deep the forum is in the current hierarchy. + * - $forum->zebra: 'even' or 'odd' string used for row class. * - $forum->name: The name of the forum. * - $forum->link: The URL to link to this forum. * - $forum->description: The description of this forum. @@ -36,28 +37,20 @@ </tr> </thead> <tbody> - <?php // Keep a row count for striping. ?> - <?php $row = 0; ?> <?php foreach ($forums as $forum): ?> - <tr class="<?php print $row % 2 == 0 ? 'odd' : 'even';?>"> - <?php if ($forum->is_container): ?> - <td colspan="4" class="container"> - <?php else: ?> - <td class="forum"> - <?php endif; ?> - <?php /* Enclose the contents of this cell with X divs, where X is the - * depth this forum resides at. This will allow us to use CSS - * left-margin for indenting. - */ ?> - <?php $end_divs = ''; ?> - <?php for ($i = 0; $i < $forum->depth; $i++): ?> - <div class="indent"> - <?php $end_divs .= '</div>'; ?> - <?php endfor; ?> + <tr class="<?php print $forum->zebra; ?>"> + <td <?php print $forum->is_container ? 'colspan="4" class="container"' : 'class="forum"'; ?>> + <?php /* Enclose the contents of this cell with X divs, where X is the + * depth this forum resides at. This will allow us to use CSS + * left-margin for indenting. + */ ?> + <?php print str_repeat('<div class="indent">', $forum->depth); ?> <div class="name"><a href="<?php print $forum->link; ?>"><?php print $forum->name; ?></a></div> - <div class="description"><?php print $forum->description; ?></div> - <?php print $end_divs; ?> - </td> + <?php if ($forum->description): ?> + <div class="description"><?php print $forum->description; ?></div> + <?php endif; ?> + <?php print str_repeat('</div>', $forum->depth); ?> + </td> <?php if (!$forum->is_container): ?> <td class="topics"> <?php print $forum->num_topics ?> @@ -70,8 +63,6 @@ <td class="last-reply"><?php print $forum->last_reply ?></td> <?php endif; ?> </tr> - - <?php $row++; ?> <?php endforeach; ?> </tbody> </table> |