function theme_advanced_forum_subforum_list in Advanced Forum 7.2
Same name and namespace in other branches
- 6.2 includes/theme.inc \theme_advanced_forum_subforum_list()
Theme function to a formatted list of subforums.
Parameters
array $variables: Array of subforums.
Return value
string Formatted list of subforums.
1 theme call to theme_advanced_forum_subforum_list()
- _advanced_forum_preprocess_forum_list in includes/
advanced_forum_preprocess_forum_list.inc - Preprocess forum list.
File
- includes/
theme.inc, line 130 - Holds theme functions and template preprocesses. Other style related functions are in style.inc
Code
function theme_advanced_forum_subforum_list(&$variables) {
$subforums = array();
foreach ($variables['subforum_list'] as $tid => $subforum) {
// Note: $subforum->name has not been run through check_plain because
// it ends up going through there when l() is called without the HTML
// option. If you change this to set HTML to TRUE, you must sanitize it.
$text = l($subforum->name, "forum/{$tid}");
$text .= ' (' . $subforum->total_posts;
if (empty($subforum->new_posts)) {
$text .= ')';
}
else {
$text .= ' - ' . l($subforum->new_posts_text, $subforum->new_posts_path, array(
'fragment' => 'new',
)) . ')';
}
$subforums[] = $text;
}
return implode(', ', $subforums);
}