You are here

function taxonomy_form_term_submit in Drupal 5

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

Accept the form submission for a taxonomy term and save the result.

File

modules/taxonomy/taxonomy.module, line 468
Enables the organization of content into categories.

Code

function taxonomy_form_term_submit($form_id, $form_values) {
  switch (taxonomy_save_term($form_values)) {
    case SAVED_NEW:
      drupal_set_message(t('Created new term %term.', array(
        '%term' => $form_values['name'],
      )));
      watchdog('taxonomy', t('Created new term %term.', array(
        '%term' => $form_values['name'],
      )), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/' . $form_values['tid']));
      break;
    case SAVED_UPDATED:
      drupal_set_message(t('Updated term %term.', array(
        '%term' => $form_values['name'],
      )));
      watchdog('taxonomy', t('Updated term %term.', array(
        '%term' => $form_values['name'],
      )), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/term/' . $form_values['tid']));
      break;
  }
  return 'admin/content/taxonomy';
}