config = $config; $this->ui = $ui; $this->storagePoints = array(get_ou("roleRDN")); // Build filter # if (session::global_is_set(get_class($this)."_filter")){ # $filter= session::global_get(get_class($this)."_filter"); # } else { $filter = new filter(get_template_path("fai-filter.xml", true)); $filter->setObjectStorage($this->storagePoints); # } $this->setFilter($filter); // Build headpage $headpage = new listing(get_template_path("fai-list.xml", true)); $headpage->setFilter($filter); // Add copy&paste and snapshot handler. if ($this->config->boolValueIsTrue("main", "copyPaste")){ $this->cpHandler = new CopyPasteHandler($this->config); } if($this->config->get_cfg_value("enableSnapshots") == "true"){ $this->snapHandler = new SnapshotHandler($this->config); } parent::__construct($config, $ui, "roles", $headpage); } function renderList() { $filter = $this->getFilter(); $headpage = $this->getHeadpage(); $filter->setComboBoxOptions("RELEASE",$this->getReleaseList()); if(isset($_POST['RELEASE'])){ $this->fai_release = get_post('RELEASE'); } $headpage->setBase($this->fai_release); $headpage->update(); $display = $headpage->render(); return($this->getHeader().$display); } function getReleaseList($base = "", $prefix ="") { $list = array(); if(empty($base)){ $base = get_ou('faiBaseRDN').$this->config->current['BASE']; $list[$base] = "/"; } $ldap = $this->config->get_ldap_link(); $ldap->ls("(objectClass=FAIbranch)",$base,array("ou","FAIstate")); $cfg_rel = $this->config->search("faiManagement","DEFAULTFAIRELEASE",array("menu")); while($release = $ldap->fetch()){ $list[$release['dn']] = $prefix.$release['ou'][0]; // Preset to prefered releaes if necessary if(empty($this->fai_release) && $cfg_rel == $release['dn']){ $this->fai_release = $release['dn']; } $list = array_merge($list,$this->getReleaseList($release['dn'],$prefix."  ")); } return($list); } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>