diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 221f62ca..79774c27 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -791,6 +791,9 @@ class accountContainer { * It prints the HTML code of each account page. */ function continue_main() { + $oldPage = $this->current_page; + $oldSubpage = $this->subpage; + $post = $_POST; $result = array(); $stopProcessing = false; // when set to true, no module options are displayed $errorsOccured = false; @@ -927,6 +930,17 @@ class accountContainer { $this->titleBarSubtitle = $typeObject->getTitleBarSubtitle($this); // prints a module content page $this->printModuleContent($result, $stopProcessing); + if (!$errorsOccured && ($oldPage == $this->current_page) && ($oldSubpage == $this->subpage) + && isset($_POST['scrollPositionTop']) && isset($_POST['scrollPositionLeft'])) { + // scroll to last position + echo ''; + } + $this->printPageFooter(); } /** @@ -945,7 +959,6 @@ class accountContainer { call_user_func_array("StatusMessage", $result[$i]); } if ($stopProcessing) { - $this->printPageFooter(); return; } } @@ -1010,7 +1023,6 @@ class accountContainer { echo "\n"; // Display rest of html-page echo "\n"; - $this->printPageFooter(); } /** @@ -1238,12 +1250,12 @@ class accountContainer { */ private function printPageHeader() { include '../main_header.php'; - echo ''; - echo "
\n"; + echo ''; + echo "\n"; } /** diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 5543e869..35fcef2a 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -403,3 +403,23 @@ function showDistributionDialog(title, okText, cancelText, scope, type, selectFi } } +/** + * Stores the current scroll position in the form. + * + * @param formName ID of form + */ +function saveScrollPosition(formName) { + var top = jQuery(window).scrollTop(); + var left = jQuery(window).scrollLeft(); + jQuery('').attr({ + type: 'hidden', + name: 'scrollPositionTop', + value: top + }).appendTo(jQuery('#' + formName)); + jQuery('').attr({ + type: 'hidden', + name: 'scrollPositionLeft', + value: left + }).appendTo(jQuery('#' + formName)); +} +