summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc')
-rw-r--r--kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc37
1 files changed, 37 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc b/kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc
new file mode 100644
index 0000000..8538310
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/forum/forum.pages.inc
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * User page callbacks for the Forum module.
+ */
+
+/**
+ * Page callback: Prints a forum listing.
+ *
+ * @param $forum_term
+ * A tree of all forums for a given taxonomy term ID. Defaults to NULL. See
+ * the return object of forum_forum_load() for a complete definition.
+ *
+ * @return
+ * A string containing HTML representing the themed forum listing.
+ *
+ * @see forum_menu()
+ */
+function forum_page($forum_term = NULL) {
+ if (!isset($forum_term)) {
+ // On the main page, display all the top-level forums.
+ $forum_term = forum_forum_load(0);
+ }
+
+ $forum_per_page = variable_get('forum_per_page', 25);
+ $sortby = variable_get('forum_order', 1);
+
+ if (empty($forum_term->container)) {
+ $topics = forum_get_topics($forum_term->tid, $sortby, $forum_per_page);
+ }
+ else {
+ $topics = '';
+ }
+
+ return theme('forums', array('forums' => $forum_term->forums, 'topics' => $topics, 'parents' => $forum_term->parents, 'tid' => $forum_term->tid, 'sortby' => $sortby, 'forums_per_page' => $forum_per_page));
+}