function lingotek_admin_additional_translation_settings_form_submit in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lingotek.admin.inc \lingotek_admin_additional_translation_settings_form_submit()
- 7.3 lingotek.admin.inc \lingotek_admin_additional_translation_settings_form_submit()
- 7.5 lingotek.admin.inc \lingotek_admin_additional_translation_settings_form_submit()
- 7.6 lingotek.admin.inc \lingotek_admin_additional_translation_settings_form_submit()
1 call to lingotek_admin_additional_translation_settings_form_submit()
2 string references to 'lingotek_admin_additional_translation_settings_form_submit'
- lingotek_admin_additional_translation_settings_form in ./
lingotek.admin.inc - Additional translation form
- lingotek_admin_comment_translation_settings_form in ./
lingotek.admin.inc - Additional translation form
File
- ./
lingotek.admin.inc, line 607
Code
function lingotek_admin_additional_translation_settings_form_submit($form, &$form_state, $additional_operations = array()) {
$form_state['values'] = array_merge($form_state['values'], $form_state['values']['config']);
system_settings_form_submit($form, $form_state);
$lingotek_use_translation_from_drupal = isset($form_state['input']['lingotek_use_translation_from_drupal']) ? $form_state['input']['lingotek_use_translation_from_drupal'] : 0;
variable_set('lingotek_use_translation_from_drupal', $lingotek_use_translation_from_drupal);
if ($lingotek_use_translation_from_drupal) {
variable_set('l10n_update_rebuild_projects', 1);
}
else {
variable_del('l10n_update_rebuild_projects');
}
//if any configuration options are set then config translation is enabled
if (variable_get('lingotek_translate_config_taxonomies', 0) || variable_get('lingotek_translate_config_blocks', 0) || variable_get('lingotek_translate_config_menus', 0) || variable_get('lingotek_translate_config_views', 0) || variable_get('lingotek_translate_config_builtins', 0)) {
variable_set('lingotek_translate_config', TRUE);
}
else {
// mark lingotek_translate_config to false if no config is to be translated
variable_set('lingotek_translate_config', FALSE);
}
// prepare for any configuration translation, if applicable
$config_groups = array();
if (variable_get('lingotek_translate_config_blocks', 0)) {
lingotek_admin_prepare_blocks();
$config_groups['blocks'] = 'blocks';
}
if (variable_get('lingotek_translate_config_taxonomies', 0)) {
lingotek_admin_prepare_taxonomies();
$config_groups['taxonomy'] = 'taxonomy';
}
if (variable_get('lingotek_translate_config_menus', 0)) {
lingotek_admin_prepare_menus();
$config_groups['menu'] = 'menu';
}
if (variable_get('lingotek_translate_config_views', 0)) {
lingotek_admin_prepare_views();
$config_groups['views'] = 'views';
}
// refresh all strings for each config type
if (count($config_groups)) {
// combine string refresh operations with other additional operations
$config_refresh_batch = i18n_string_refresh_batch($config_groups, $delete = FALSE);
if (isset($config_refresh_batch['operations'])) {
$additional_operations = array_merge($additional_operations, $config_refresh_batch['operations']);
}
}
if (variable_get('lingotek_translate_config_builtins')) {
lingotek_admin_prepare_builtins($additional_operations);
}
else {
lingotek_admin_setup_nonbuiltins_batch($additional_operations);
}
// if this function is being called as part of the setup process, continue to
// the dashboard to make sure they get a language configured. Otherwise,
// put them back to the settings page when finished.
$final_destination = 'admin/settings/lingotek/settings';
if (isset($_SESSION['lingotek_setup_path']) && is_array($_SESSION['lingotek_setup_path']) && end($_SESSION['lingotek_setup_path']) == 'admin/config/lingotek/additional-translation-settings') {
$final_destination = 'admin/settings/lingotek';
}
if (count(batch_get())) {
batch_process($final_destination);
}
else {
drupal_goto($final_destination);
}
}