You are here

function taxonomy_tools_confirm_term_delete in Taxonomy Tools 8

Same name and namespace in other branches
  1. 7 taxonomy_tools.admin.inc \taxonomy_tools_confirm_term_delete()

Build term deletion confirmation form.

1 call to taxonomy_tools_confirm_term_delete()
taxonomy_tools_overview in ./taxonomy_tools.admin.inc
Build taxonomy overview form.

File

./taxonomy_tools.admin.inc, line 520
Administrative page callbacks for the Taxonomy Tools module.

Code

function taxonomy_tools_confirm_term_delete($form, &$form_state, $vocabulary, $root) {

  // Prepare the identifiers of terms that will be deleted.
  foreach ($form_state['values'] as $key => $value) {
    if (is_numeric(strpos($key, 'delete_')) && $value == 1) {
      $explode = explode('_', $key);
      $form[$key] = array(
        '#type' => 'value',
        '#value' => $explode[1],
      );
    }
  }

  // Identifies that term deletion is confirmed.
  $form['term_delete'] = array(
    '#type' => 'value',
    '#value' => TRUE,
  );
  return confirm_form($form, t('Are you sure you want to delete the selected terms?'), $_GET['q'], t('Deleted terms will be removed permanently!'), t('Delete terms'), t('Cancel'));
}