You are here

function advanced_forum_process_container in Advanced Forum 6.2

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

Prepare an individual container for display.

1 call to advanced_forum_process_container()
_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/advanced_forum_preprocess_forum_list.inc, line 224
Holds the contents of a preprocess function moved into its own file to ease memory requirements and having too much code in one file.

Code

function advanced_forum_process_container($container) {

  // Create the link to the container.
  $container->link = url("forum/{$container->tid}");

  // Sanitise the name and description so they can be safely printed.
  $container->name = check_plain($container->name);
  $container->description = !empty($container->description) ? filter_xss_admin($container->description) : '';

  // Create a variable to check if the item is a container in the template.
  $container->is_container = TRUE;

  // @TODO: Make the icon change if subforums have posts.
  $container->icon_classes = "forum-list-icon forum-list-icon-default";
  $container->icon_text = t("No new");

  // Add in the taxonomy image, if any.
  if (function_exists('taxonomy_image_display') && variable_get('advanced_forum_use_taxonomy_image', TRUE)) {
    $container->forum_image = taxonomy_image_display($container->tid, NULL, variable_get('advanced_forum_use_taxonomy_image_preset', ''));
  }

  // Initialize these variables to avoid notices later.
  $container->total_topics = 0;
  $container->new_topics = 0;
  $container->total_posts = 0;
  $container->new_posts = 0;
  $container->child_total_topics = 0;
  $container->child_new_topics = 0;
  $container->child_total_posts = 0;
  $container->child_new_posts = 0;
  return $container;
}