Code

Added list footer to divlist class.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Aug 2007 06:24:35 +0000 (06:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Aug 2007 06:24:35 +0000 (06:24 +0000)
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
include/class_MultiSelectWindow.inc
include/class_divlist.inc
plugins/admin/users/class_divListUsers.inc

index 3145a7c14988b7aad0470826ef08a15a21977f85..40e739a2111d7b898bce55708251943c46c93d57 100644 (file)
@@ -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;
index 49a1ad89b6e4d0f7330091c2af3401d99bb86f01..4ccc27c488ffada6b4f89543e083a36397a21c77 100644 (file)
@@ -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());
index 2c28bc7cfa37525ec75cbddcefd96ffaff19c502..17176b217b9ce96ffbe8d5f2b743a2a0ecc61291 100644 (file)
@@ -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.= "</table>";
                
                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<tr><td class='scrollhead'><table summary='' style='width:100%' cellspacing='0' id='t_scrollfoot'>";
+        } else {
+          $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:100%' cellspacing='0'                      id='t_scrollfoot_onlywidth'>";
+        }
+      }
+      $s_return .= "<tr><td class='listfooter' style='border-bottom:0px;'>".$this->list_footer."</td>";
+          // 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<td class='listfooter' style='width:13px;border-right:0px;'>&nbsp;</td>";
+      $s_return.= "\n</table></td>";
+    }
+
+    $s_return.= "\n</tr>";
+
+    }
+    return($s_return);
+  }
        
        function _generateHeader(){
                $s_return = "";
index 12fb740ac096e326d7daf050b4572a81fe48b758..245db51ed532930a6da0df679c141a9844e7df6f 100644 (file)
@@ -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()