You are here

function _content_admin_field_submit in Content Construction Kit (CCK) 6

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

Save a field's settings after editing.

File

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

Code

function _content_admin_field_submit($form, &$form_state) {
  module_load_include('inc', 'content', 'includes/content.crud');
  $form_values = $form_state['values'];

  // If the widget type has changed, update the widget module, too.
  $widget_types = _content_widget_types();
  $form_values['widget_module'] = $widget_types[$form_values['widget_type']]['module'];
  unset($form_values['default_value_widget']);
  content_field_instance_update($form_values);
  drupal_set_message(t('Saved field %label.', array(
    '%label' => $form_values['label'],
  )));
  $type = content_types($form_values['type_name']);
  $form_state['redirect'] = 'admin/content/node-type/' . $type['url_str'] . '/fields';
}