1 system.module system_settings_form_submit($form, &$form_state)

Form submission handler for system_settings_form().

If you want node type configure style handling of your checkboxes, add an array_filter value to your form.

@since 1.6.0 Restored and made compatible with configuration management.

File

core/modules/system/system.module, line 4628
Configuration system that lets administrators modify the workings of the site.

Code

function system_settings_form_submit($form, &$form_state) {
  form_state_values_clean($form_state);

  if (!empty($form['#config'])) {
    $configs = _system_sort_form_values_by_config($form, $form_state, $form['#config']);
    foreach ($configs as $bucket => $data) {
      config_set_multiple($bucket, $data);
    }
  }
  else {
    watchdog('form', 'Backdrop 2.0 and later will require forms using system_settings_form() to set $form[\'#config\'].', array(), WATCHDOG_DEPRECATED);
    if (!settings_get('backdrop_drupal_compatibility')) {
      backdrop_set_message(t('Settings not saved: Drupal compatibility layer is disabled and this form has not been updated to use Backdrop configuration management.'), 'error');
      return;
    }

    foreach ($form_state['values'] as $key => $value) {
      if (is_array($value) && isset($form_state['values']['array_filter'])) {
        $value = array_keys(array_filter($value));
      }
      variable_set($key, $value);
    }
  }

  backdrop_set_message(t('The configuration options have been saved.'));
}