diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-30 18:58:12 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-08-30 18:58:12 +0000 |
commit | d82fe113bc4093356c7ef5f8ee210ca4340dced8 (patch) | |
tree | 527b6d96b52efdfb3ee8b44d69af0f481c26940a | |
parent | 6d25504ce2bb5cda44f1f328720c46c6f6e2de4b (diff) | |
download | brdo-d82fe113bc4093356c7ef5f8ee210ca4340dced8.tar.gz brdo-d82fe113bc4093356c7ef5f8ee210ca4340dced8.tar.bz2 |
#53905 by fax8, Gurpartap Singh and dvessel: give meaningful names to term variables in forum templates and add unique IDs for easier themeing
-rw-r--r-- | modules/forum/forum-list.tpl.php | 11 | ||||
-rw-r--r-- | modules/forum/forum-topic-list.tpl.php | 3 | ||||
-rw-r--r-- | modules/forum/forum.module | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/modules/forum/forum-list.tpl.php b/modules/forum/forum-list.tpl.php index f6a74255a..46dbd5ed9 100644 --- a/modules/forum/forum-list.tpl.php +++ b/modules/forum/forum-list.tpl.php @@ -6,7 +6,10 @@ * Default theme implementation to display a list of forums and containers. * * Available variables: - * - $forums: An array of forums and containers to display. + * - $forums: An array of forums and containers to display. It is keyed to the + * numeric id's of all child forums and containers. + * - $forum_id: Forum id for the current forum. Parent to all items within + * the $forums array. * * Each $forum in $forums contains: * - $forum->is_container: Is TRUE if the forum can contain other forums. Is @@ -28,7 +31,7 @@ * @see theme_forum_list() */ ?> -<table> +<table id="forum-<?php print $forum_id; ?>"> <thead> <tr> <th><?php print t('Forum'); ?></th> @@ -38,8 +41,8 @@ </tr> </thead> <tbody> - <?php foreach ($forums as $forum): ?> - <tr class="<?php print $forum->zebra; ?>"> + <?php foreach ($forums as $child_id => $forum): ?> + <tr id="forum-list-<?php print $child_id; ?>" 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 diff --git a/modules/forum/forum-topic-list.tpl.php b/modules/forum/forum-topic-list.tpl.php index 71c4ef337..5995850e2 100644 --- a/modules/forum/forum-topic-list.tpl.php +++ b/modules/forum/forum-topic-list.tpl.php @@ -10,6 +10,7 @@ * information. If you need to change this, @see template_preprocess_forum_topic_list(). * - $pager: The pager to display beneath the table. * - $topics: An array of topics to be displayed. + * - $topic_id: Numeric id for the current forum topic. * * Each $topic in $topics contains: * - $topic->icon: The icon to display. @@ -32,7 +33,7 @@ * @see theme_forum_topic_list() */ ?> -<table> +<table id="forum-topic-<?php print $topic_id; ?>"> <thead> <tr><?php print $header; ?></tr> </thead> diff --git a/modules/forum/forum.module b/modules/forum/forum.module index bf505fc6f..61c52ad09 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -742,6 +742,9 @@ function template_preprocess_forum_list(&$variables) { } $variables['forums'][$id]->last_reply = theme('forum_submitted', $forum->last_post); } + // Give meaning to $tid for themers. $tid actually stands for term id. + $variables['forum_id'] = $variables['tid']; + unset($variables['tid']); } /** @@ -799,6 +802,9 @@ function template_preprocess_forum_topic_list(&$variables) { // Make this safe for the template $variables['topics'] = array(); } + // Give meaning to $tid for themers. $tid actually stands for term id. + $variables['topic_id'] = $variables['tid']; + unset($variables['tid']); $variables['pager'] = theme('pager', NULL, $variables['forum_per_page'], 0); } |