You are here

function taxonomy_manager_confirm_delete in Taxonomy Manager 6.2

Same name and namespace in other branches
  1. 5 taxonomy_manager.module \taxonomy_manager_confirm_delete()
  2. 6 taxonomy_manager.admin.inc \taxonomy_manager_confirm_delete()
  3. 7 taxonomy_manager.admin.inc \taxonomy_manager_confirm_delete()

confirmation form for deleting selected terms

1 call to taxonomy_manager_confirm_delete()
taxonomy_manager_form in ./taxonomy_manager.admin.inc
defines forms for taxonomy manager interface

File

./taxonomy_manager.admin.inc, line 425
Taxonomy Manager Admin

Code

function taxonomy_manager_confirm_delete($voc) {
  drupal_add_js(array(
    'hideForm' => array(
      'show_button' => 'edit-delete-confirm',
      'hide_button' => 'edit-delete-cancel',
      'div' => 'del-confirm-form',
    ),
  ), 'setting');
  $form = array();
  $form['delete'] = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'id' => 'del-confirm-form',
      'style' => 'display:none;',
    ),
    '#tree' => TRUE,
    '#title' => t('Confirmation'),
  );
  $question = t('Are you sure you want to delete all selected terms? ');
  $info = t('Remember all term specific data will be lost. This action cannot be undone.');
  $form['delete']['text'] = array(
    '#value' => "<b>" . $question . "</b><br/>" . $info,
  );
  $options = array(
    'delete_orphans' => t('Delete children of selected terms, if there are any'),
  );
  $form['delete']['options'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Options'),
    '#options' => $options,
  );
  $form['delete']['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
    '#attributes' => array(
      'class' => 'taxonomy-manager-buttons delete',
    ),
    '#submit' => array(
      'taxonomy_manager_form_delete_submit',
    ),
    '#validate' => array(
      'taxonomy_manager_form_delete_validate',
    ),
  );
  $form['delete']['cancel'] = array(
    '#type' => 'button',
    '#attributes' => array(
      'class' => 'taxonomy-manager-buttons cancel',
    ),
    '#value' => t('Cancel'),
    '#theme' => 'no_submit_button',
  );
  return $form;
}