X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_MultiSelectWindow.inc;h=2dac54752192607d99238d9c39206413c59f828c;hb=5dca72f94c1ab450a58e5e76ff6f1929766eac42;hp=fee7d60acab6d7f8873f1729ecf0a30ab45d4e30;hpb=f9b93677ea18e1c62d042c2f404852c5d9c7fd81;p=gosa.git diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index fee7d60ac..2dac54752 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -154,6 +154,64 @@ class MultiSelectWindow{ $this->array_Elements[] = $arr; } + + /* Return default header part. With back, home and root icons and department selection */ + function get_default_header() + { + $enable_back = TRUE; + $enable_root = TRUE; + $enable_home = TRUE; + + $ui = get_userinfo(); + + /* Check if selectedBase = first available base */ + $deps = $ui->get_module_departments($this->module); + + if(!count($deps) || $deps[0] == $this->selectedBase){ + $enable_back = FALSE; + $enable_root = FALSE; + } + + /* Check if we are in users home department */ + if(!count($deps) ||$this->selectedBase == get_base_from_people($ui->dn)){ + $enable_home = FALSE; + } + + /* Create header with selected base */ + $listhead = "
"; + + /* Draw root button */ + if($enable_root){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Root")." "; + } + + /* Draw back button */ + if($enable_back){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Up")." "; + } + + /* Draw home button */ + if($enable_home){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Home")." "; + } + + /* And at least draw reload button, this button is enabled everytime */ + $listhead .= "  ". + " - "; + + return ($listhead); + } + /* Add a checkbox to the filter element, the name specifies an existing class var to store the 'selection' */ function AddCheckBox($name,$value="Unset",$string="Unset",$default=false)