You are here

function _content_admin_field_remove in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6 includes/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 ./fieldgroup.module

File

./content_admin.inc, line 678
Administrative interface for content type creation.

Code

function _content_admin_field_remove($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/types/' . $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;
}