Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRouslan Placella <rouslan@placella.com>2012-07-22 19:05:58 +0400
committerRouslan Placella <rouslan@placella.com>2012-10-31 00:23:59 +0400
commit9008ba42fa16fb01ee3271d0263da7d74158f557 (patch)
treeda386fe4779214ad0cb7e9d3616e93249ac5ca6d
parent50266d206b974d2e6003a39aef1577eeb3eaab35 (diff)
Dropped server side functionality for reloading the left frame from user preferences forms
-rw-r--r--libraries/Footer.class.php9
-rw-r--r--libraries/user_preferences.lib.php29
-rw-r--r--prefs_forms.php6
-rw-r--r--prefs_manage.php12
4 files changed, 7 insertions, 49 deletions
diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php
index 7fe2667e22..aeaa5d52d6 100644
--- a/libraries/Footer.class.php
+++ b/libraries/Footer.class.php
@@ -93,15 +93,6 @@ class PMA_Footer
window.parent.refreshNavigation();
}"
);
- } else if (isset($_GET['reload_left_frame'])
- && $_GET['reload_left_frame'] == '1'
- ) {
- // reload left frame (used by user preferences)
- $this->_scripts->addCode(
- "if (window.parent && window.parent.frame_navigation) {
- window.parent.frame_navigation.location.reload();
- }"
- );
}
// set current db, table and sql query in the querywindow
diff --git a/libraries/user_preferences.lib.php b/libraries/user_preferences.lib.php
index afc8b50d36..94699ad7fa 100644
--- a/libraries/user_preferences.lib.php
+++ b/libraries/user_preferences.lib.php
@@ -223,42 +223,17 @@ function PMA_persistOption($path, $value, $default_value)
/**
* Redirects after saving new user preferences
*
- * @param array $forms
- * @param array $old_settings
* @param string $file_name
* @param array $params
* @param string $hash
*
* @return void
*/
-function PMA_userprefsRedirect(array $forms, array $old_settings, $file_name,
+function PMA_userprefsRedirect($file_name,
$params = null, $hash = null
) {
- $reload_left_frame = isset($params['reload_left_frame']) && $params['reload_left_frame'];
- if (!$reload_left_frame) {
- // compute differences and check whether left frame should be refreshed
- $old_settings = isset($old_settings['config_data'])
- ? $old_settings['config_data']
- : array();
- $new_settings = ConfigFile::getInstance()->getConfigArray();
- $diff_keys = array_keys(
- array_diff_assoc($old_settings, $new_settings)
- + array_diff_assoc($new_settings, $old_settings)
- );
- $check_keys = array('NaturalOrder', 'DefaultTabDatabase',
- 'Server/hide_db', 'Server/only_db');
- $check_keys = array_merge(
- $check_keys, $forms['Left_frame']['Left_frame'],
- $forms['Left_frame']['Left_databases']
- );
- $diff = array_intersect($check_keys, $diff_keys);
- $reload_left_frame = !empty($diff);
- }
-
// redirect
- $url_params = array(
- 'saved' => 1,
- 'reload_left_frame' => $reload_left_frame);
+ $url_params = array('saved' => 1);
if (is_array($params)) {
$url_params = array_merge($params, $url_params);
}
diff --git a/prefs_forms.php b/prefs_forms.php
index e613c0cd8e..52d25d91e6 100644
--- a/prefs_forms.php
+++ b/prefs_forms.php
@@ -52,15 +52,15 @@ if (isset($_POST['revert'])) {
$error = null;
if ($form_display->process(false) && !$form_display->hasErrors()) {
// save settings
- $old_settings = PMA_loadUserprefs();
$result = PMA_saveUserprefs(ConfigFile::getInstance()->getConfigArray());
if ($result === true) {
// reload config
$GLOBALS['PMA_Config']->loadUserPreferences();
$hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#');
PMA_userprefsRedirect(
- $forms, $old_settings, 'prefs_forms.php',
- array('form' => $form_param), $hash
+ 'prefs_forms.php',
+ array('form' => $form_param),
+ $hash
);
exit;
} else {
diff --git a/prefs_manage.php b/prefs_manage.php
index 05b51ad051..01be5b8d8f 100644
--- a/prefs_manage.php
+++ b/prefs_manage.php
@@ -142,29 +142,24 @@ if (isset($_POST['submit_export'])
) {
$_SESSION['PMA_Theme_Manager']->setActiveTheme($config['ThemeDefault']);
$_SESSION['PMA_Theme_Manager']->setThemeCookie();
- $params['reload_left_frame'] = true;
}
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_loadUserprefs();
$result = PMA_saveUserprefs($cf->getConfigArray());
if ($result === true) {
if ($return_url) {
@@ -183,14 +178,13 @@ if (isset($_POST['submit_export'])
}
// reload config
$GLOBALS['PMA_Config']->loadUserPreferences();
- PMA_userprefsRedirect($forms, $old_settings, $return_url, $params);
+ PMA_userprefsRedirect($return_url, $params);
exit;
} else {
$error = $result;
}
}
} else if (isset($_POST['submit_clear'])) {
- $old_settings = PMA_loadUserprefs();
$result = PMA_saveUserprefs(array());
if ($result === true) {
$params = array();
@@ -200,15 +194,13 @@ if (isset($_POST['submit_export'])
);
unset($_SESSION['PMA_Theme_Manager']);
unset($_SESSION['PMA_Theme']);
- $params['reload_left_frame'] = true;
}
if ($GLOBALS['PMA_Config']->get('fontsize') != '82%') {
$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_userprefsRedirect($forms, $old_settings, 'prefs_manage.php', $params);
+ PMA_userprefsRedirect('prefs_manage.php', $params);
exit;
} else {
$error = $result;