You are here

function taxonomy_multidelete_term_finished in Taxonomy Multi-delete Terms 7

Batch 'finished' callback.

1 string reference to 'taxonomy_multidelete_term_finished'
taxonomy_multidelete_term_confirm_delete_terms_submit in ./taxonomy_multidelete_term.module
Delete terms after confirmation.

File

./taxonomy_multidelete_term.module, line 369
Taxonomy multi delete module use to delete terms in bulk.

Code

function taxonomy_multidelete_term_finished($success, $results, $operations) {
  if ($success) {
    $delete_terms = $results['terms'];
    $deleted_terms_name = implode(', ', $delete_terms);
    drupal_set_message(t('Deleted term(s) %name.', array(
      '%name' => $deleted_terms_name,
    )));
    watchdog('taxonomy', 'Deleted term(s) %name.', array(
      '%name' => $deleted_terms_name,
    ), WATCHDOG_NOTICE);
    cache_clear_all();
  }
  else {

    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array(
      '@operation' => $error_operation[0],
      '@args' => print_r($error_operation[0], TRUE),
    )));
  }
}