You are here

function forum_overview in Drupal 6

Same name and namespace in other branches
  1. 4 modules/forum.module \forum_overview()
  2. 5 modules/forum/forum.module \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/forum.module
Implementation of hook_menu().

File

modules/forum/forum.admin.inc, line 216
Administrative page callbacks for the forum module.

Code

function forum_overview(&$form_state) {
  module_load_include('inc', 'taxonomy', 'taxonomy.admin');
  $vid = variable_get('forum_nav_vocabulary', '');
  $vocabulary = taxonomy_vocabulary_load($vid);
  $form = taxonomy_overview_terms($form_state, $vocabulary);
  foreach (element_children($form) as $key) {
    if (isset($form[$key]['#term'])) {
      $term = $form[$key]['#term'];
      $form[$key]['view']['#value'] = l($term['name'], 'forum/' . $term['tid']);
      if (in_array($form[$key]['#term']['tid'], variable_get('forum_containers', array()))) {
        $form[$key]['edit']['#value'] = l(t('edit container'), 'admin/content/forum/edit/container/' . $term['tid']);
      }
      else {
        $form[$key]['edit']['#value'] = l(t('edit forum'), 'admin/content/forum/edit/forum/' . $term['tid']);
      }
    }
  }

  // Remove the alphabetical reset.
  unset($form['reset_alphabetical']);

  // The form needs to have submit and validate handlers set explicitly.
  $form['#theme'] = 'taxonomy_overview_terms';
  $form['#submit'] = array(
    'taxonomy_overview_terms_submit',
  );

  // Use the existing taxonomy overview submit handler.
  $form['#validate'] = array(
    'taxonomy_overview_terms_validate',
  );
  $form['#empty_text'] = '<em>' . t('There are no existing containers or forums. Containers and forums may be added using the <a href="@container">add container</a> and <a href="@forum">add forum</a> pages.', array(
    '@container' => url('admin/content/forum/add/container'),
    '@forum' => url('admin/content/forum/add/forum'),
  )) . '</em>';
  return $form;
}