From 4fcfca3c5c5e5bbd94f87a79906710d2b4baba53 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 8 Aug 2007 06:24:35 +0000 Subject: [PATCH] Added list footer to divlist class. We are able to shown a footer message for each list now git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6992 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/themes/default/style.css | 7 ++++ include/class_MultiSelectWindow.inc | 4 +-- include/class_divlist.inc | 37 ++++++++++++++++++++-- plugins/admin/users/class_divListUsers.inc | 31 ++++++++++++++++-- 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/html/themes/default/style.css b/html/themes/default/style.css index 3145a7c14..40e739a21 100644 --- a/html/themes/default/style.css +++ b/html/themes/default/style.css @@ -23,6 +23,13 @@ td.listheader { height:22px; } +td.listfooter { + background:#E5E5E5; + border-top:1px solid #C0C0C0; + padding:3px; + height:16px; +} + td.scrollhead { vertical-align:top; padding:0px; diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 49a1ad89b..4ccc27c48 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -298,7 +298,8 @@ class MultiSelectWindow{ $divlist = new divlist($this->string_Title); $divlist->SetSummary($this->string_Summary); - $divlist->SetEntriesPerPage(0); // 0 for scrollable list + $divlist->SetEntriesPerPage(0); // 0 for scrollable list + $divlist->SetFooter($this->get_List_Bottom_Info()); if($this->DivHeight != ""){ $divlist->SetHeight($this->DivHeight); @@ -377,7 +378,6 @@ class MultiSelectWindow{ $smarty->assign("Summary" , $this->string_Summary); $smarty->assign("Title" , $this->string_Title); $smarty->assign("Information" , $this->string_Information); - $smarty->assign("List_Bottom_Info", $this->get_List_Bottom_Info()); /* Check for exeeded sizelimit */ $smarty->assign("hint" , print_sizelimit_warning()); diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 2c28bc7cf..17176b217 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -17,6 +17,7 @@ class divlist { var $i_entriesPerPage; var $force_height = false; + var $list_footer = ""; // Added php 4 constructor function divlist($pageid){ @@ -37,6 +38,11 @@ class divlist { } + function SetFooter($str) + { + $this->list_footer = $str; + } + function AddEntry($a_entriedata) { $this->a_entries[] = $a_entriedata; } @@ -78,8 +84,8 @@ class divlist { } $s_return.= $this->_generateHeader(); - $s_return.=$this->_generatePage(); - + $s_return.= $this->_generatePage(); + $s_return.= $this->_generateFooter(); $s_return.= ""; return ($s_return); @@ -99,6 +105,33 @@ class divlist { function _numentries(){ return count($this->a_entries); } + + function _generateFooter() + { + $s_return = ""; + if(!empty($this->list_footer)){ + + // Using scrolltable? + if($this->i_entriesPerPage == 0) { + if(!$this->force_height) { + $s_return.= "\n"; + } else { + $s_return.= "\n"; + } + + $s_return.= "\n"; + + } + return($s_return); + } function _generateHeader(){ $s_return = ""; diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 12fb740ac..245db51ed 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -266,8 +266,35 @@ class divListUsers extends MultiSelectWindow $users[strtolower( $val['sn']['0'].$val['uid']['0'])]=$add; } } - - $this->set_List_Bottom_Info(sprintf(_("%s User(s), %s Template(s), %s Department(s)"),$num_users,$num_templates,count($this->Added_Departments) * !$this->SubSearch)); + + /* Create summary string for list footer */ + $str = $num_users." "; + if($num_users != 1){ + $str .= _("Users").", "; + }else{ + $str .= _("User").", "; + } + + $str.= $num_templates." "; + if($num_templates != 1){ + $str .= _("Templates").", "; + }else{ + $str .= _("Template").", "; + } + + $num_deps=0; + if(!$this->SubSearch){ + $num_deps = count($this->Added_Departments); + } + + $str.= $num_deps." "; + if($num_deps != 1){ + $str .= _("Departments"); + }else{ + $str .= _("Department"); + } + + $this->set_List_Bottom_Info($str); } function Save() -- 2.30.2
"; + } + } + $s_return .= ""; + // Attach a 13px-wide column (used as scrollbar space in body-table), + // but do this only if we are really using scrolltables. + if($this->i_entriesPerPage == 0) { + $s_return.= "\n"; + $s_return.= "\n
".$this->list_footer."