Code

Some updates
[gosa.git] / include / class_divlist.inc
index 69d43a1fb1b97005c0c3ba17f11d575cf1a41168..cd12a5ebdf206bce265b25f4900e6dc206bd33eb 100644 (file)
@@ -16,8 +16,8 @@ class divlist {
        var $i_currentPage;
        var $i_entriesPerPage;
 
-  var $height_forced  = false;
-
+  var $force_height = false;
+  
        // Added php 4 constructor
        function divlist($pageid){
 
@@ -51,7 +51,7 @@ class divlist {
        
   function SetHeight($s_height) {
                $this->s_height= $s_height;
-    $this->height_forced =true;
+    $this->force_height = true;
        }
   
   function SetWidth($s_width) {
@@ -64,9 +64,15 @@ class divlist {
        
        function DrawList(){
                $s_return = "";
-               $s_return.= "<table summary='".$this->s_summary."' style='width:".
-                $this->s_width."px;height:".$this->s_height.
-                "px;' cellspacing='0' id='t_scrolltable'>";
+    if(!$this->force_height){
+                 $s_return.= "<table summary='".$this->s_summary."' style='width:".
+                  $this->s_width."px;height:".$this->s_height.
+                  "px;' cellspacing='0' id='t_scrolltable'>";
+    } else {
+                 $s_return.= "<table summary='".$this->s_summary."' style='width:".
+                  $this->s_width."px;height:".$this->s_height.
+                  "px;' cellspacing='0' id='t_scrolltable_onlywidth'>";
+    }
 
     $s_return.= $this->_generateHeader();
     $s_return.=$this->_generatePage();
@@ -98,7 +104,11 @@ class divlist {
                
     // Using scrolltable?
     if($this->i_entriesPerPage == 0) {
-      $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width."px;' cellspacing='0' id='t_scrollhead'>";
+      if(!$this->force_height) {
+        $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width."px;' cellspacing='0' id='t_scrollhead'>";
+      } else {
+        $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:".$this->s_width."px;' cellspacing='0' id='t_scrollhead_onlywidth'>";
+      }
     }
 
                $s_return.= "\n<tr>";
@@ -138,8 +148,13 @@ class divlist {
    
     if($this->i_entriesPerPage == 0) {
       // We need to construct a "body"-table that is width-of-scrollbar thinner than the "head"-table.
-      $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width."px;height:".($this->s_height-20)."px;' id='d_scrollbody' class='scrollbody'>";
-      $s_return .= "<table summary='' style='height:100%;width:581px;' cellspacing='0' id='t_scrollbody'>";
+      if(!$this->force_height) {
+        $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width."px;height:".($this->s_height-20)."px;' id='d_scrollbody' class='scrollbody'>";
+        $s_return .= "<table summary='' style='height:100%;width:581px;' cellspacing='0' id='t_scrollbody'>";
+      } else {
+        $s_return .= "\n<tr><td colspan='".$this->cols."' class='scrollbody'><div style='width:".$this->s_width."px;height:".($this->s_height-20)."px;' id='d_scrollbody_onlywidth' class='scrollbody'>";
+        $s_return .= "<table summary='' style='height:100%;width:581px;' cellspacing='0' id='t_scrollbody_onlywidth'>";
+      }
        }
  
     $i_alternate=0;
@@ -181,7 +196,7 @@ class divlist {
                                                        
                                $s_value = $this->a_entries[$i];
                                
-                               
+                   // Alternation of background color          
                                if($i_alternate) $i_alternate=0; else $i_alternate=1;
                                
                                $s_return .= "\n<tr>";