function content_field_remove_form in Content Construction Kit (CCK) 6.3
Same name and namespace in other branches
- 6.2 includes/content.admin.inc \content_field_remove_form()
Menu callback; present a form for removing a field from a content type.
2 string references to 'content_field_remove_form'
- content_menu in ./
content.module - Implementation of hook_menu().
- fieldgroup_form_alter in modules/
fieldgroup/ fieldgroup.module - Implementation of hook_form_alter()
File
- includes/
content.admin.inc, line 909 - Administrative interface for content type creation.
Code
function content_field_remove_form(&$form_state, $type_name, $field_name) {
$type = content_types($type_name);
$field = $type['fields'][$field_name];
$form = array();
$form['type_name'] = array(
'#type' => 'value',
'#value' => $type_name,
);
$form['field_name'] = array(
'#type' => 'value',
'#value' => $field_name,
);
$output = confirm_form($form, t('Are you sure you want to remove the field %field?', array(
'%field' => $field['widget']['label'],
)), 'admin/content/node-type/' . $type['url_str'] . '/fields', t('If you have any content left in this field, it will be lost. This action cannot be undone.'), t('Remove'), t('Cancel'), 'confirm');
if ($field['locked']) {
unset($output['actions']['submit']);
$output['description']['#value'] = t('This field is <strong>locked</strong> and cannot be removed.');
}
return $output;
}