function taxonomy_manager_term_confirm_delete in Taxonomy Manager 6.2
Same name and namespace in other branches
- 6 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.
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 1241 - Taxonomy Manager Admin
Code
function taxonomy_manager_term_confirm_delete(&$form_state, $vid, $vid2 = NULL) {
if (isset($vid2)) {
$form['vid2'] = array(
'#type' => 'value',
'#value' => $vid2,
);
$url = 'admin/content/taxonomy_manager/double-tree/' . $vid . '/' . $vid2;
}
else {
$url = 'admin/content/taxonomy_manager/voc/' . $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: '), $url, $msg, t('Delete'), t('Cancel'));
}