content_admin_field_overview_form_submit

Versions
5
content_admin_field_overview_form_submit($form_id, $form_values)

Code

contributions/cck/content_admin.inc, line 308

<?php
function content_admin_field_overview_form_submit($form_id, $form_values) {
  $msg = FALSE;
  foreach ((array) $form_values['field-groups'] as $key => $value) {
    if ($key && !in_array($key, unserialize($form_values['disabled']))) {
      $values  = array('field_name' => $key, 'group' => $value, 'type_name' => $form_values['type_name']);
      $default = $form_values['field-groups-defaults'][$key];
      fieldgroup_content_admin_form_submit('_content_admin_field', $values, $default);
      $msg = TRUE;
    }
  }
  if ($msg) {
    drupal_set_message(t('Updated field groups.'));
  }
  $msg = FALSE;
  foreach ((array) $form_values['group-weights'] as $key => $value) {
    if ($key && !in_array($key, unserialize($form_values['disabled']))) {
      db_query("UPDATE {node_group} SET weight = %d WHERE type_name = '%s' AND group_name = '%s'",
        $value, $form_values['type_name'], $key);
      $msg = TRUE;
    }
  }
  if ($msg) {
    drupal_set_message(t('Updated group weights.'));
  }
  $msg = FALSE;
  foreach ((array) $form_values['field-weights'] as $key => $value) {
    if ($key && !in_array($key, unserialize($form_values['disabled']))) {
      db_query("UPDATE {node_field_instance} SET weight = %d WHERE type_name = '%s' AND field_name = '%s'",
        $value, $form_values['type_name'], $key);
      $msg = TRUE;
    }
  }
  if ($msg) {
    drupal_set_message(t('Updated field weights.'));
  }
  content_clear_type_cache();
  cache_clear_all('fieldgroup_data', 'cache_content');

}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.