save lang and collation_connection to user preferences

This commit is contained in:
Crack
2010-07-19 23:57:12 +02:00
parent 8c28b69aba
commit c67340d023
3 changed files with 72 additions and 26 deletions

View File

@@ -133,15 +133,27 @@ if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') ==
// check for ThemeDefault and fontsize
$params = array();
if (isset($config['ThemeDefault'])
&& $_SESSION['PMA_Theme_Manager']->theme->getId() != $config['ThemeDefault']
&& $_SESSION['PMA_Theme_Manager']->checkTheme($config['ThemeDefault'])) {
$_SESSION['PMA_Theme_Manager']->setActiveTheme($config['ThemeDefault']);
$_SESSION['PMA_Theme_Manager']->setThemeCookie();
$params['reload_left_frame'] = true;
}
if (isset($config['fontsize'])) {
if (isset($config['fontsize'])
&& $config['fontsize'] != $GLOBALS['PMA_Config']->get('fontsize')) {
$params['set_fontsize'] = $config['fontsize'];
$params['reload_left_frame'] = true;
}
if (isset($config['lang'])
&& $config['lang'] != $GLOBALS['lang']) {
$params['lang'] = $config['lang'];
$params['reload_left_frame'] = true;
}
if (isset($config['collation_connection'])
&& $config['collation_connection'] != $GLOBALS['collation_connection']) {
$params['collation_connection'] = $config['collation_connection'];
$params['reload_left_frame'] = true;
}
// save settings
$old_settings = PMA_load_userprefs();
@@ -182,6 +194,8 @@ if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') ==
$GLOBALS['PMA_Config']->removeCookie('pma_fontsize');
$params['reload_left_frame'] = true;
}
$GLOBALS['PMA_Config']->removeCookie('pma_collaction_connection');
$GLOBALS['PMA_Config']->removeCookie('pma_lang');
PMA_userprefs_redirect($forms, $old_settings, 'prefs_manage.php', $params);
exit;
} else {