diff --git a/mod/admin.php b/mod/admin.php index cca109f48..97bde76ca 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1163,6 +1163,7 @@ function admin_page_site_post(App $a) $relay_scope = ((x($_POST,'relay_scope')) ? Strings::escapeTags(trim($_POST['relay_scope'])) : ''); $relay_server_tags = ((x($_POST,'relay_server_tags')) ? Strings::escapeTags(trim($_POST['relay_server_tags'])) : ''); $relay_user_tags = ((x($_POST,'relay_user_tags')) ? True : False); + $active_panel = (defaults($_POST, 'active_panel', '') ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : ''); // Has the directory url changed? If yes, then resubmit the existing profiles there if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) { @@ -1344,7 +1345,8 @@ function admin_page_site_post(App $a) Config::set('system', 'rino_encrypt', $rino); info(L10n::t('Site settings updated.') . EOL); - $a->internalRedirect('admin/site'); + + $a->internalRedirect('admin/site' . $active_panel); return; // NOTREACHED } diff --git a/view/theme/frio/templates/admin/site.tpl b/view/theme/frio/templates/admin/site.tpl index 6a6deb1e0..c0241cd0e 100644 --- a/view/theme/frio/templates/admin/site.tpl +++ b/view/theme/frio/templates/admin/site.tpl @@ -40,13 +40,14 @@ }); $(function(){ $(".collapse").on('show.bs.collapse', function(e) { - localStorage.setItem('activeTab', $(e.target).attr('id')); + var id = $(e.target).attr('id'); + $("input[name=active_panel]").val(id); }); - var activeTab = localStorage.getItem('activeTab'); - if (activeTab) { - $("#" + activeTab).collapse('show'); - window.scroll(0, $("#" + activeTab).offset().top - 120); - localStorage.removeItem('activeTab'); + var url = document.location.toString(); + if ( url.match('#') ) { + var element = '#'+url.split('#')[1]; + $(element).addClass('in'); + window.scroll(0, $(element).offset().top - 120); } }); @@ -56,6 +57,7 @@