X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_MultiSelectWindow.inc;h=bc99ac9f1857a4d9cf972d3cb67958ec1b694422;hb=cf52f2875e8d24c2985898e38bfe03acf8900e44;hp=9d3b10008d59553723e9353114984316a412634e;hpb=0f0cdd3a98e4a9c1fb8c3dde2d2db000f28b44c5;p=gosa.git diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 9d3b10008..bc99ac9f1 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -13,6 +13,7 @@ class MultiSelectWindow{ var $string_Title = ""; var $string_ListHeader = ""; + var $string_ListDropDown= ""; var $string_Summary = ""; var $string_Information = ""; @@ -73,6 +74,33 @@ class MultiSelectWindow{ $this->array_Regexes[] = $arr; } + + function SetDropDownHeaderMenu($str) + { + $this->string_ListDropDown = $str; + } + + function GetDropDownHeaderMenu() + { + if(!empty($this->string_ListDropDown)){ + $mid = new LayersMenu(6, 7, 2, 1); + $mid->setImgwww("./images/"); + $mid->setIcondir("./images/"); + $mid->setDirroot("/storage/hickert/gosa/include/php_layers_menu/"); + $mid->setHorizontalMenuTpl('GOsa_MultiSelectHeader.ihtml'); + $mid->setMenuStructureString($this->string_ListDropDown); + $mid->parseStructureForMenu('menu'); + $mid->newHorizontalMenu('menu'); + $s = $mid->getHeader(); + $s.= $mid->getMenu('menu'); + $s.= $mid->getFooter('menu'); + return($s); + }else{ + return(""); + } + } + + /* Contrucktion */ function MultiSelectWindow(&$config, $filterName, $module) { @@ -81,7 +109,7 @@ class MultiSelectWindow{ $this->SaveButtonString = _("Save"); $this->CloseButtonString = _("Close"); $this->filterName = $filterName; - + $this->ui = get_userinfo(); $this->selectedBase = $_SESSION['CurrentMainBase']; /* Check default values for SaveAdditionalVars */ @@ -172,15 +200,14 @@ class MultiSelectWindow{ $enable_back = FALSE; $enable_root = FALSE; } - + + $listhead =""; + /* 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 .= " assign("Display_alphabet", $this->bool_DisplayAlpahabet); $smarty->assign("alphabet", generate_alphabet()); - $smarty->assign("Header" , $this->string_ListHeader ); + $smarty->assign("Header" , $this->string_ListHeader); + $smarty->assign("HeaderDropDown", $this->GetDropDownHeaderMenu()); $smarty->assign("Summary" , $this->string_Summary); $smarty->assign("Title" , $this->string_Title); $smarty->assign("Information" , $this->string_Information); @@ -470,7 +498,9 @@ class MultiSelectWindow{ if($s_action=="root"){ $this->selectedBase=($this->config->current['BASE']); $dep_id = $this->ui->get_module_departments($this->module); - $this->selectedBase = $dep_id[key($dep_id)]; + if(isset($dep_id[key($dep_id)])){ + $this->selectedBase = $dep_id[key($dep_id)]; + } }