You are here

function taxonomy_form_vocabulary_submit in Drupal 5

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

Accept the form submission for a vocabulary and save the results.

File

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

Code

function taxonomy_form_vocabulary_submit($form_id, $form_values) {

  // Fix up the nodes array to remove unchecked nodes.
  $form_values['nodes'] = array_filter($form_values['nodes']);
  switch (taxonomy_save_vocabulary($form_values)) {
    case SAVED_NEW:
      drupal_set_message(t('Created new vocabulary %name.', array(
        '%name' => $form_values['name'],
      )));
      watchdog('taxonomy', t('Created new vocabulary %name.', array(
        '%name' => $form_values['name'],
      )), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/' . $form_values['vid']));
      break;
    case SAVED_UPDATED:
      drupal_set_message(t('Updated vocabulary %name.', array(
        '%name' => $form_values['name'],
      )));
      watchdog('taxonomy', t('Updated vocabulary %name.', array(
        '%name' => $form_values['name'],
      )), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/' . $form_values['vid']));
      break;
  }
  return 'admin/content/taxonomy';
}