You are here

function _content_admin_field_remove in Content Construction Kit (CCK) 6

Same name and namespace in other branches
  1. 5 content_admin.inc \_content_admin_field_remove()

Menu callback; present a form for removing a field from a content type.

2 string references to '_content_admin_field_remove'
content_menu in ./content.module
Implementation of hook_menu().
fieldgroup_form_alter in modules/fieldgroup/fieldgroup.module

File

includes/content.admin.inc, line 596
Administrative interface for content type creation.

Code

function _content_admin_field_remove(&$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');
  return $output;
}