function domain_prefix_configure_form_submit in Domain Access 5
Same name and namespace in other branches
- 6.2 domain_prefix/domain_prefix.admin.inc \domain_prefix_configure_form_submit()
FormsAPI for the domain_prefix_configure_form.
File
- domain_prefix/
domain_prefix.module, line 254 - Interface for selective table prefixing for use with Domain Access. For this module to work correctly, you will need to follow the INSTALL.txt instructions for editing your settings.php file.
Code
function domain_prefix_configure_form_submit($form_id, $form_values) {
// Throw away what we don't need.
$options = $form_values['domain_prefix_options'];
$unset = array(
'op',
'submit',
'restore',
'form_token',
'form_id',
'domain_prefix_options',
);
$data = $form_values;
foreach ($unset as $key) {
unset($data[$key]);
}
if ($form_values['op'] == $form_values['restore']) {
variable_del('domain_prefix');
drupal_set_message(t('Default prefix settings reset.'));
}
else {
// Process the source data.
foreach ($data as $key => $value) {
if (substr($key, 0, 8) == '_source_') {
$info['sources'][$key] = $value;
}
else {
$info['settings'][$key] = $value;
}
}
$settings = serialize($info);
variable_set('domain_prefix', $settings);
drupal_set_message(t('Default prefix settings changed.'));
}
variable_set('domain_prefix_options', $options);
}