get('vocabulary')); if (!isset($forum_term)) { // On the main page, display all the top-level forums. $forum_term = forum_forum_load(0); // Set the page title to forum's vocabulary name. drupal_set_title($vocabulary->label()); } // Breadcrumb navigation. $breadcrumb[] = l(t('Home'), NULL); if ($forum_term->tid) { // Parent of all forums is the vocabulary name. $breadcrumb[] = l($vocabulary->label(), 'forum'); } // Add all parent forums to breadcrumbs. if ($forum_term->parents) { foreach (array_reverse($forum_term->parents) as $parent) { if ($parent->id() != $forum_term->tid) { $breadcrumb[] = l($parent->label(), 'forum/' . $parent->id()); } } } drupal_set_breadcrumb($breadcrumb); if ($forum_term->tid && array_search($forum_term->tid, $config->get('containers')) === FALSE) { // Add RSS feed for forums. drupal_add_feed('taxonomy/term/' . $forum_term->id() . '/feed', 'RSS - ' . $forum_term->label()); } if (empty($forum_term->forums) && empty($forum_term->parents)) { // Root of empty forum. drupal_set_title(t('No forums defined')); } $forum_per_page = $config->get('topics.page_limit'); $sort_by = $config->get('topics.order'); if (empty($forum_term->container)) { $topics = forum_get_topics($forum_term->tid, $sort_by, $forum_per_page); } else { $topics = ''; } $build = array( '#theme' => 'forums', '#forums' => $forum_term->forums, '#topics' => $topics, '#parents' => $forum_term->parents, '#tid' => $forum_term->tid, '#sortby' => $sort_by, '#forums_per_page' => $forum_per_page, ); $build['#attached']['css'][] = drupal_get_path('module', 'forum') . '/forum.css'; return $build; }