function advanced_forum_process_container in Advanced Forum 7.2
Same name and namespace in other branches
- 6.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 - Preprocess forum list.
File
- includes/
advanced_forum_preprocess_forum_list.inc, line 257 - 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");
// 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;
// Rename these to make them more descriptive.
if (isset($container->num_topics)) {
$container->total_topics = $container->num_topics;
unset($container->num_topics);
}
if (isset($container->num_posts)) {
$container->total_posts = $container->num_posts;
unset($container->num_posts);
}
return $container;
}