You are here

function forum_overview in Drupal 4

Same name and namespace in other branches
  1. 5 modules/forum/forum.module \forum_overview()
  2. 6 modules/forum/forum.admin.inc \forum_overview()
  3. 7 modules/forum/forum.admin.inc \forum_overview()

Returns an overview list of existing forums and containers

1 string reference to 'forum_overview'
forum_menu in modules/forum.module
Implementation of hook_menu().

File

modules/forum.module, line 575
Enable threaded discussions about general topics.

Code

function forum_overview() {
  $header = array(
    t('Name'),
    t('Operations'),
  );
  $tree = taxonomy_get_tree(_forum_get_vid());
  if ($tree) {
    foreach ($tree as $term) {
      if (in_array($term->tid, variable_get('forum_containers', array()))) {
        $rows[] = array(
          _taxonomy_depth($term->depth) . ' ' . check_plain($term->name),
          l(t('edit container'), "admin/forum/edit/container/{$term->tid}"),
        );
      }
      else {
        $rows[] = array(
          _taxonomy_depth($term->depth) . ' ' . check_plain($term->name),
          l(t('edit forum'), "admin/forum/edit/forum/{$term->tid}"),
        );
      }
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => '<em>' . t('There are no existing containers or forums. You may add some on the <a href="%container">add container</a> or <a href="%forum">add forum</a> pages.', array(
          '%container' => url('admin/forum/add/container'),
          '%forum' => url('admin/forum/add/forum'),
        )) . '</em>',
        'colspan' => 2,
      ),
    );
  }
  return theme('table', $header, $rows);
}