You are here

function taxonomy_manager_confirm_delete in Taxonomy Manager 7

Same name and namespace in other branches
  1. 5 taxonomy_manager.module \taxonomy_manager_confirm_delete()
  2. 6.2 taxonomy_manager.admin.inc \taxonomy_manager_confirm_delete()
  3. 6 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 467

Code

function taxonomy_manager_confirm_delete(&$form, $voc) {
  $form['#attached']['js'][] = array(
    'data' => array(
      'hideForm' => array(
        array(
          'show_button' => 'edit-delete-confirm',
          'hide_button' => 'edit-delete-cancel',
          'div' => 'edit-delete',
        ),
      ),
    ),
    'type' => 'setting',
  );
  $form['toolbar']['delete_confirm'] = array(
    //'#type' => 'button',
    '#attributes' => array(
      'class' => array(
        'taxonomy-manager-buttons delete',
      ),
    ),
    '#value' => t('Delete'),
    '#theme' => 'no_submit_button',
  );
  $form['delete'] = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'style' => 'display:none;',
      'id' => 'edit-delete',
    ),
    '#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' => array(
        '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' => array(
        'taxonomy-manager-buttons',
        'cancel',
      ),
    ),
    '#value' => t('Cancel'),
    '#theme' => 'no_submit_button',
  );
}