From: hickert Date: Tue, 9 May 2006 09:20:53 +0000 (+0000) Subject: Added variable num of cols when adding departments automatically X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5a11b09e7633a95e5f2a084c3bef917bbb7cd15c;p=gosa.git 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 --- 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); } } }