Code

Added variable num of cols when adding departments automatically
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 May 2006 09:20:53 +0000 (09:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 May 2006 09:20:53 +0000 (09:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3229 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_MultiSelectWindow.inc

index 80e6fe9b2dcd3616a0ab48c4bd2574c6831ea341..6ac6bbaf795eaa485d77df74bdfc130e6717cb5d 100644 (file)
@@ -326,11 +326,8 @@ class MultiSelectWindow{
        }
 
        /* this function adds the sub-departments of the current tree to the list */
-       function AddDepartments($base = false)
+       function AddDepartments($base = false,$numtabs = 3)
        {
-               
-               #FIXME the num of header cols must match the num of entry cols .        
-       
                /* check for a valid base */
                if(!$base){
                        if(!isset($_SESSION['CurrentMainBase'])){
@@ -383,11 +380,20 @@ class MultiSelectWindow{
                                }
                        }
 
+                       
                        /* Add to divlist */
-                       $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
-                       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
-                       $field3 = array("string" => "&nbsp;", "attach" => "style='width:60px;border-right:0px;text-align:right;'");
-                       $this->AddElement(array($field1,$field2,$field3));
+                       $row = array();
+                       $row[] = $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
+                       $row[] = $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
+                       $row[] = $field3 = array("string" => "&nbsp;", "attach" => "style='width:60px;border-right:0px;text-align:right;'");
+
+                       if($numtabs > 3){       
+                               for($i = 3 ; $i <= $numtabs;$i++){
+                                       $row[] = array("string"=>"&nbsp;");
+                               }
+                       }
+
+                       $this->AddElement($row);
                }
        }
 }