From 78a6813efd2f0b4eb471a688685a2abf1429ebf8 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 19 Jan 2010 09:46:47 +0000 Subject: [PATCH] Save scroll position git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15192 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_listing.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index 9001f584a..ab6d59443 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -52,6 +52,7 @@ class listing { var $exportColumns= array(); var $useSpan= false; var $height= 0; + var $scrollPosition= 0; function listing($filename) @@ -273,6 +274,7 @@ class listing { // Initialize list $result= "\n"; + $result.= "\n"; $height= 450; if ($this->height != 0) { $result.= "\n"; @@ -425,6 +427,12 @@ class listing { $result.= ""; $result.= $switch?"":""; + // Add scroll positioner + $result.= ''; + $smarty= get_smarty(); $smarty->assign("usePrototype", "true"); $smarty->assign("FILTER", $this->filter->render()); @@ -473,6 +481,11 @@ class listing { return; } + // Save position if set + if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) { + $this->scrollPosition= $_POST['position_'.$this->pid]; + } + // Save base if (isset($_POST['BASE']) && $this->baseMode) { $base= get_post('BASE'); @@ -1011,6 +1024,11 @@ class listing { return; } + // Save position if set + if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) { + $this->scrollPosition= $_POST['position_'.$this->pid]; + } + $result= array("targets" => array(), "action" => ""); // Filter GET with "act" attributes -- 2.30.2