diff --git a/js/config.js b/js/config.js index 882849c48..1b0ceddd4 100644 --- a/js/config.js +++ b/js/config.js @@ -498,6 +498,7 @@ function setTab(tab_id) { $('.tabs a').removeClass('active').filter('[href=' + tab_id + ']').addClass('active'); $('.tabs_contents fieldset').hide().filter(tab_id).show(); location.hash = 'tab_' + tab_id.substr(1); + $('.config-form input[name=tab_hash]').val(location.hash); } $(function() { diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index 20018c804..e4a39d4af 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -27,6 +27,7 @@ function display_form_top($action = null, $method = 'post', $hidden_fields = nul } ?>
+ display(); // warn about using session storage for settings $cfgRelation = PMA_getRelationsParam(); if (!$cfgRelation['userconfigwork']) { - $msg = __('Your preferences will be saved for current session only. Storing them permanently requires %spmadb%s.'); - $msg = PMA_sanitize(sprintf($msg, '[a@http://wiki.phpmyadmin.net/pma/pmadb@_blank]', '[/a]')); + $msg = __('Your preferences will be saved for current session only. Storing them permanently requires %sphpMyAdmin configuration storage%s.'); + $msg = PMA_sanitize(sprintf($msg, '[a@./Documentation.html#linked-tables@_blank]', '[/a]')); PMA_Message::notice($msg)->display(); } diff --git a/libraries/user_preferences.lib.php b/libraries/user_preferences.lib.php index d89f79c51..0f10b5816 100644 --- a/libraries/user_preferences.lib.php +++ b/libraries/user_preferences.lib.php @@ -217,8 +217,9 @@ function PMA_persist_option($path, $value, $default_value) * @param array $old_settings * @param string $file_name * @param array $params + * @param string $hash */ -function PMA_userprefs_redirect(array $forms, array $old_settings, $file_name, $params = null) +function PMA_userprefs_redirect(array $forms, array $old_settings, $file_name, $params = null, $hash = null) { $reload_left_frame = isset($params['reload_left_frame']) && $params['reload_left_frame']; if (!$reload_left_frame) { @@ -243,8 +244,11 @@ function PMA_userprefs_redirect(array $forms, array $old_settings, $file_name, $ if (is_array($params)) { $url_params = array_merge($params, $url_params); } + if ($hash) { + $hash = '#' . urlencode($hash); + } PMA_sendHeaderLocation($GLOBALS['cfg']['PmaAbsoluteUri'] . $file_name - . PMA_generate_common_url($url_params, '&')); + . PMA_generate_common_url($url_params, '&') . $hash); } function PMA_userprefs_autoload_header() diff --git a/prefs_forms.php b/prefs_forms.php index 3db7a1682..2e170bf5a 100644 --- a/prefs_forms.php +++ b/prefs_forms.php @@ -61,8 +61,9 @@ if (!$form_display->process(false)) { $old_settings = PMA_load_userprefs(); $result = PMA_save_userprefs($cf->getConfigArray()); if ($result === true) { + $hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#'); PMA_userprefs_redirect($forms, $old_settings, 'prefs_forms.php', array( - 'form' => $form_param)); + 'form' => $form_param), $hash); exit; } else { $result->display();