function locale_languages_edit_form_submit in Drupal 6
Same name and namespace in other branches
- 7 modules/locale/locale.admin.inc \locale_languages_edit_form_submit()
Process the language editing form submission.
Related topics
1 string reference to 'locale_languages_edit_form_submit'
- locale_languages_edit_form in includes/
locale.inc - Editing screen for a particular language.
File
- includes/
locale.inc, line 368 - Administration functions for locale.module.
Code
function locale_languages_edit_form_submit($form, &$form_state) {
db_query("UPDATE {languages} SET name = '%s', native = '%s', domain = '%s', prefix = '%s', direction = %d WHERE language = '%s'", $form_state['values']['name'], $form_state['values']['native'], $form_state['values']['domain'], $form_state['values']['prefix'], $form_state['values']['direction'], $form_state['values']['langcode']);
$default = language_default();
if ($default->language == $form_state['values']['langcode']) {
$properties = array(
'name',
'native',
'direction',
'enabled',
'plurals',
'formula',
'domain',
'prefix',
'weight',
);
foreach ($properties as $keyname) {
if (isset($form_state['values'][$keyname])) {
$default->{$keyname} = $form_state['values'][$keyname];
}
}
variable_set('language_default', $default);
}
$form_state['redirect'] = 'admin/settings/language';
return;
}