function spaces_preset_default_form_submit in Spaces 6.2
Same name and namespace in other branches
- 5.2 spaces_admin.inc \spaces_preset_default_form_submit()
- 6 spaces_admin.inc \spaces_preset_default_form_submit()
Submit handler for spaces_preset_default_form().
1 string reference to 'spaces_preset_default_form_submit'
- spaces_preset_default_form in ./
spaces_admin.inc - Page callback for generating a list of spaces presets. (admin/build/spaces)
File
- ./
spaces_admin.inc, line 90
Code
function spaces_preset_default_form_submit($form, &$form_state) {
$default_presets = variable_get('spaces_default_presets', array());
foreach (spaces_types() as $type => $dummy) {
if (isset($form_state['values']['types'][$type]['default']) && !empty($form_state['values']['types'][$type]['default'])) {
$default_presets[$type] = $form_state['values']['types'][$type]['default'];
}
else {
unset($default_presets[$type]);
}
}
variable_set('spaces_default_presets', $default_presets);
drupal_set_message(t('Spaces preset defaults were saved successfully.'));
}