You are here

function chosen_admin_settings_form_submit in Chosen 7.3

Implementation of chosen_admin_settings_form_submit().

Callback function for chosen_admin_settings(). Save the submitted values by plugin type.

See also

settings_form_submit

_chosen_devide_array_by_plugin

1 string reference to 'chosen_admin_settings_form_submit'
chosen_form_chosen_admin_settings_alter in ./chosen.module
Implements hook_form_FORM_ID_alter().

File

./chosen.module, line 69
General functions and hook implementations.

Code

function chosen_admin_settings_form_submit($form, &$form_state) {

  // Exclude unnecessary elements.
  form_state_values_clean($form_state);
  $values = _chosen_devide_array_by_plugin($form_state['values']);

  // Save values by plugin.
  foreach ($values as $plugin_name => $values) {
    variable_set('chosen_' . $plugin_name, $values);
  }
  drupal_set_message(t('The configuration options have been saved.'));
}