From: hickert Date: Fri, 15 Dec 2006 07:38:59 +0000 (+0000) Subject: Added a function that generate us the back, home and root button. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e24f6ac989f04d9b24818b2f1e8687cd4302f9bb;p=gosa.git Added a function that generate us the back, home and root button. Not in use currently git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5407 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index fee7d60ac..6f939f96c 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -154,6 +154,63 @@ 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($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)){ + $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)