X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_MultiSelectWindow.inc;h=9aec3065250bb7bfea0b514db0804cb09ba554bc;hb=a2227f5221dbb0f33f4bd21d785569f5abb1225b;hp=6f939f96c1baf4237a09560ec0fd3231205ffa21;hpb=e24f6ac989f04d9b24818b2f1e8687cd4302f9bb;p=gosa.git diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 6f939f96c..9aec30652 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -166,18 +166,19 @@ class MultiSelectWindow{ /* Check if selectedBase = first available base */ $deps = $ui->get_module_departments($this->module); - if($deps[0] == $this->selectedBase){ + + if(!count($deps) || $deps[0] == $this->selectedBase){ $enable_back = FALSE; $enable_root = FALSE; } /* Check if we are in users home department */ - if($this->selectedBase == get_base_from_people($ui->dn)){ + if(!count($deps) ||$this->selectedBase == get_base_from_people($ui->dn)){ $enable_home = FALSE; } /* Create header with selected base */ - $listhead = "
"; + $listhead = "
"; /* Draw root button */ if($enable_root){ @@ -349,7 +350,7 @@ class MultiSelectWindow{ - @@ -596,7 +597,7 @@ class MultiSelectWindow{ /* this function adds the sub-departments of the current tree to the list */ - function AddDepartments($base = false,$numtabs = 3) + function AddDepartments($base = false,$numtabs = 3,$empty_tabs_in_front = 0) { $this->DepartmentsAdded = true; @@ -634,6 +635,11 @@ class MultiSelectWindow{ } natcasesort($this->departments); + + if($empty_tabs_in_front){ +# $numtabs -= $empty_tabs_in_front; + } + /* Add deps to this dialog object list */ foreach($this->departments as $key=> $val){ @@ -655,19 +661,25 @@ class MultiSelectWindow{ /* Add to divlist */ $row = array(); + + if($empty_tabs_in_front){ + for($i = 0; $i < $empty_tabs_in_front ; $i ++){ + $row[] = array("string"=>" ", "attach" => "style='text-align:center;width:20px;'"); + } + } + $row[]=$field1=array("string"=>"department","attach"=>"style='text-align:center;width:20px;'"); $row[]=$field2=array("string"=>sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''"); if($numtabs > 2){ - for($i = 2 ; $i <$numtabs;$i++){ - if(isset( $this->array_Header[$i]['attach'])){ - $row[] = array("string"=>" ","attach" => $this->array_Header[$i]['attach']); + for($i = 2 ; $i < $numtabs;$i++){ + if(isset( $this->array_Header[$i + $empty_tabs_in_front]['attach'])){ + $row[] = array("string"=>" ","attach" => $this->array_Header[$i + $empty_tabs_in_front]['attach']); }else{ $row[] = array("string"=>" "); } } } - $this->AddElement($row); } }