function taxonomy_manager_term_confirm_delete in Taxonomy Manager 7
Same name and namespace in other branches
- 6.2 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete()
- 6 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete()
Form builder for the term delete form.
2 calls to taxonomy_manager_term_confirm_delete()
- taxonomy_manager_double_tree_form in ./
taxonomy_manager.admin.inc - taxonomy_manager_form in ./
taxonomy_manager.admin.inc - defines forms for taxonomy manager interface
File
- ./
taxonomy_manager.admin.inc, line 1436
Code
function taxonomy_manager_term_confirm_delete($form, &$form_state, $vid, $vid2 = NULL) {
$voc = taxonomy_vocabulary_load($vid);
if (isset($vid2)) {
$voc2 = taxonomy_vocabulary_load($vid2);
$form['voc2'] = array(
'#type' => 'value',
'#value' => $voc2,
);
$url = 'admin/structure/taxonomy_manager/double-tree/' . $voc->machine_name . '/' . $voc2->machine_name;
}
else {
$url = 'admin/structure/taxonomy_manager/voc/' . $voc->machine_name;
}
$selected = $form_state['values']['taxonomy']['manager']['tree']['selected_terms'];
$form['selected_terms'] = array(
'#prefix' => '<ul>',
'#suffix' => '</ul>',
'#tree' => TRUE,
);
foreach ($selected as $tid) {
$term = taxonomy_term_load($tid);
$form['selected_terms'][$tid] = array(
'#type' => 'hidden',
'#value' => $tid,
'#prefix' => '<li>',
'#suffix' => check_plain($term->name) . "</li>\n",
);
}
$form['delete'] = array(
'#type' => 'value',
'#value' => TRUE,
);
$form['voc'] = array(
'#type' => 'value',
'#value' => $voc,
);
$form['options'] = array(
'#type' => 'value',
'#value' => $form_state['values']['delete']['options'],
);
$msg = !empty($form_state['values']['delete']['options']['delete_orphans']) ? t('Deleting a term will delete all its children if there are any.') : '';
$msg .= t('This action cannot be undone.');
return confirm_form($form, t('Are you sure you want to delete the following terms:'), $url, $msg, t('Delete'), t('Cancel'));
}