function taxonomy_manager_term_confirm_delete in Taxonomy Manager 6
Same name and namespace in other branches
- 6.2 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete()
- 7 taxonomy_manager.admin.inc \taxonomy_manager_term_confirm_delete()
Form builder for the term delete form.
1 call to taxonomy_manager_term_confirm_delete()
- taxonomy_manager_form in ./
taxonomy_manager.admin.inc - defines forms for taxonomy manager interface
File
- ./
taxonomy_manager.admin.inc, line 851
Code
function taxonomy_manager_term_confirm_delete(&$form_state, $vid) {
$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_get_term($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['vid'] = array(
'#type' => 'value',
'#value' => $vid,
);
$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: '), 'admin/content/taxonomy_manager/voc/' . $vid, $msg, t('Delete'), t('Cancel'));
}