You are here

function theme_advanced_forum_subforum_list in Advanced Forum 6.2

Same name and namespace in other branches
  1. 7.2 includes/theme.inc \theme_advanced_forum_subforum_list()

Theme function to a formatted list of subforums.

Parameters

$subforum_list: Array of subforums.

Return value

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
@file Holds the contents of a preprocess function moved into its own file to ease memory requirements and having too much code in one file.

File

includes/theme.inc, line 164
Holds theme functions and template preprocesses. Other style related functions are in style.inc

Code

function theme_advanced_forum_subforum_list($subforum_list) {
  $subforums = array();
  foreach ($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);
}