From: hickert Date: Tue, 2 Aug 2005 06:10:18 +0000 (+0000) Subject: Page position will be saved in Lists now X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=05a70113feca1d8aa9964c07d58b86916ecb61ff;p=gosa.git Page position will be saved in Lists now git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1040 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_divlist.inc b/include/class_divlist.inc index d94da0bfe..7b62d34c5 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -7,22 +7,23 @@ class divlist { var $b_displayPageNums; var $summary; var $cols; + var $pageid; // Members for page managment var $i_currentPage; var $i_entriesPerPage; - function __construct(){ - $this->i_currentPage =0; - $this->i_entriesPerPage =10; - $this->s_summary =""; - $this->a_entries =array(); - $this->a_header =array(); - $this->b_displayPageNums =true; - $this->cols = 0; + function __construct($pageid){ + $this->i_currentPage = 0; + $this->i_entriesPerPage = 10; + $this->s_summary = ""; + $this->a_entries = array(); + $this->a_header = array(); + $this->b_displayPageNums= true; + $this->cols = 0; + $this->pageid = $pageid ; } - function __destruct(){ @@ -108,12 +109,21 @@ class divlist { $i_alternate=0; if(isset($_GET['start'])){ + $_SESSION['start'.$this->pageid]=$_GET['start']; $start = $_GET['start']; }else{ - $start=0; + if(isset($_SESSION['start'.$this->pageid])){ + $start = $_SESSION['start'.$this->pageid]; + }else{ + $start=0; + } } - $stop = $start + $this->i_entriesPerPage; + while($start > $this->_numentries()){ + $start = $start - $this->i_entriesPerPage; + } + + $stop = $start + $this->i_entriesPerPage; $appendempty = ($this->_numentries() -$start); diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index fb4d3f98d..4ac2c0ca0 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -358,7 +358,7 @@ class applicationManagement extends plugin $empty = ""; - $divlist = new divlist(); + $divlist = new divlist("applicationtabs"); $divlist->SetHeader(array( array("string" => ""), array("string" => _("Application name")." / "._("Department")), diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index ceb81431b..79f1807a1 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -290,7 +290,7 @@ class departmentManagement extends plugin ""; /* Show main page */ - $divlist = new divlist(); + $divlist = new divlist("departmenttabs"); $divlist->SetSummary(_("This table displays all departments, in the selected tree.")); $divlist->SetEntriesPerPage(20); $actions= ""; diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index a3fde2f34..ae0356d76 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -388,7 +388,7 @@ class groupManagement extends plugin $empty = ""; - $divlist = new divlist(); + $divlist = new divlist("groupstab"); $divlist->SetHeader(array( array("string" => " "), array("string" => _("Groupname")." / "._("Department")), diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 4d01afdba..060d36c0a 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -394,7 +394,7 @@ name='dep_root' alt='"._("Root")."'> ". $empty = ""; // List Setup - $divlist = new divlist(); + $divlist = new divlist("ogroubstab"); $divlist->SetHeader(array( array("string" => " ","attach"=>"style='width:20px;'"), array("string" => _("Name of object groups")." / "._("Departments")), diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index e34d4802b..c6195ce8b 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -547,7 +547,7 @@ class systems extends plugin $action.= ""; - $divlist = new divlist(); + $divlist = new divlist("systemstab"); $divlist->SetHeader(array( array("string" => " "), array("string" => _("System")." / "._("Department")), diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 4f00b4709..7e8d1ea0f 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -636,7 +636,7 @@ class userManagement extends plugin - $divlist = new divlist(); + $divlist = new divlist("userstab"); $divlist->SetHeader(array( array("string" => " "), array("string" => _("Username")." / "._("Department")), diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index 10a682e84..bc42936f2 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -299,7 +299,7 @@ class blocklist extends plugin $action.= ""; - $divlist = new divlist(); + $divlist = new divlist("faxtabs"); $divlist->SetHeader(array( array("string" => " "), array("string" => _("Blocklist name")." / "._("Department")), diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index 1190f7ba5..24e34e856 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -336,7 +336,7 @@ class gofonMacro extends plugin $action= ""; $action.= ""; - $divlist = new divlist(); + $divlist = new divlist("macrotabs"); $divlist->SetHeader(array( array("string" => " "), array("string" => _("Username")." / "._("Department")),