function variable_settings_form_submit in Variable 7.2
Execute the system_settings_form.
If you want node type configure style handling of your checkboxes, add an array_filter value to your form.
2 string references to 'variable_settings_form_submit'
- variable_form_alter in ./
variable.module - Implements hook_form_alter().
- variable_settings_form in ./
variable.module - Add default buttons to a form and set its prefix.
File
- ./
variable.module, line 798 - Variable API module
Code
function variable_settings_form_submit($form, &$form_state) {
// Exclude unnecessary elements.
form_state_values_clean($form_state);
// This may contain some realm options.
$options = isset($form['#variable_options']) ? $form['#variable_options'] : array();
// Now run regular settings submission but using variable_set_value()
foreach ($form_state['values'] as $key => $value) {
if (is_array($value) && isset($form_state['values']['array_filter'])) {
$value = array_keys(array_filter($value));
}
// Using this function will invoke variable_update hook.
variable_set_value($key, $value, $options);
}
drupal_set_message(t('The configuration options have been saved.'));
}