From 5a11b09e7633a95e5f2a084c3bef917bbb7cd15c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 9 May 2006 09:20:53 +0000 Subject: [PATCH] Added variable num of cols when adding departments automatically git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3229 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_MultiSelectWindow.inc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 80e6fe9b2..6ac6bbaf7 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -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" => "department", "attach" => "style='text-align:center;width:20px;'"); - $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''"); - $field3 = array("string" => " ", "attach" => "style='width:60px;border-right:0px;text-align:right;'"); - $this->AddElement(array($field1,$field2,$field3)); + $row = array(); + $row[] = $field1 = array("string" => "department", "attach" => "style='text-align:center;width:20px;'"); + $row[] = $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''"); + $row[] = $field3 = array("string" => " ", "attach" => "style='width:60px;border-right:0px;text-align:right;'"); + + if($numtabs > 3){ + for($i = 3 ; $i <= $numtabs;$i++){ + $row[] = array("string"=>" "); + } + } + + $this->AddElement($row); } } } -- 2.30.2