forum_overview

5 forum.module forum_overview()
6 forum.admin.inc forum_overview(&$form_state)
7 forum.admin.inc forum_overview($form, &$form_state)
8 forum.admin.inc forum_overview($form, &$form_state)

Returns an overview list of existing forums and containers

1 string reference to 'forum_overview'

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);
}
Login or register to post comments