You are here

function forum_form_submit in Drupal 5

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

Process forum form and container form submissions.

File

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

Code

function forum_form_submit($form_id, $form_values) {
  if ($form_id == 'forum_form_container') {
    $container = TRUE;
    $type = t('forum container');
  }
  else {
    $container = FALSE;
    $type = t('forum');
  }
  $status = taxonomy_save_term($form_values);
  switch ($status) {
    case SAVED_NEW:
      if ($container) {
        $containers = variable_get('forum_containers', array());
        $containers[] = $form_values['tid'];
        variable_set('forum_containers', $containers);
      }
      drupal_set_message(t('Created new @type %term.', array(
        '%term' => $form_values['name'],
        '@type' => $type,
      )));
      break;
    case SAVED_UPDATED:
      drupal_set_message(t('The @type %term has been updated.', array(
        '%term' => $form_values['name'],
        '@type' => $type,
      )));
      break;
  }
  return 'admin/content/forum';
}