You are here

function taxonomy_manager_term_confirm_delete_submit in Taxonomy Manager 7

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete_submit()
  2. 6 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete_submit()

Submit handler to delete a term after confirmation.

2 calls to taxonomy_manager_term_confirm_delete_submit()
taxonomy_manager_form_delete_submit in ./taxonomy_manager.admin.inc
Submit handler for deleting terms
taxonomy_manager_form_submit in ./taxonomy_manager.admin.inc
submits the taxonomy manager form (only search button)

File

./taxonomy_manager.admin.inc, line 1471

Code

function taxonomy_manager_term_confirm_delete_submit($form, &$form_state) {
  $info = taxonomy_manager_delete_terms($form_state['values']['selected_terms'], $form_state['values']['options']);
  $deleted_term_names = array();
  $remaining_child_term_names = array();
  foreach ($info['deleted_terms'] as $term) {
    $deleted_term_names[] = $term->name;
  }
  foreach ($info['remaining_child_terms'] as $term) {
    $remaining_child_term_names[] = $term->name;
  }
  if (isset($form_state['values']['voc2'])) {
    $form_state['redirect'] = 'admin/structure/taxonomy_manager/double-tree/' . $form_state['values']['voc']->machine_name . '/' . $form_state['values']['voc2']->machine_name;
  }
  else {
    $form_state['redirect'] = 'admin/structure/taxonomy_manager/voc/' . $form_state['values']['voc']->machine_name;
  }
  drupal_set_message(t("Deleted terms: %deleted_term_names", array(
    '%deleted_term_names' => check_plain(implode(', ', $deleted_term_names)),
  )));
  if (count($remaining_child_term_names)) {
    drupal_set_message(t("Remaining child terms with different parents: %remaining_child_term_names", array(
      '%remaining_child_term_names' => check_plain(implode(', ', $remaining_child_term_names)),
    )));
  }
  return;
}