"Eins ist toll", "zwei" => "Zwei ist noch besser"); /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); var $objectclasses = array(); var $mirrors = array(); // The possible mirror,release and section combinations var $servers = array(); // All available server var $sections = array(); // All sections var $releases = array(); // Releases var $FAIdebianRelease = ""; // The selected release var $FAIdebianSection = array(); // selected section var $FAIdebianMirror = ""; // selected mirror var $obj; function faiPackageNew ($config, $dn= NULL,$mirrors,$servers,$sections,$releases) { plugin::plugin ($config, $dn); $this->mirrors = $mirrors; $this->servers = $servers; $this->sections = $sections; $this->releases = $releases; foreach($this->sections as $sec){ $this->sections[$sec] =false; } } function execute() { /* Fill templating stuff */ $smarty = get_smarty(); $display = ""; // reset grayout options $disableRelease = false; $disableMirror = false; $disableContinue = false; $disableSection = false; /* Post handling for Section, Release and Mirror Setup */ if(isset($_POST['SetRepository'])){ foreach($this->sections as $sec => $val){ if(isset($_POST[$sec])){ $this->sections[$sec]=true; $this->FAIdebianSection[$sec]=$sec; }else{ $this->sections[$sec]=false; } } } /* Grayout settings */ if(empty($this->FAIdebianRelease)){ $disableSection = $disableMirror = $disableContinue = true; }elseif(empty($this->FAIdebianSection)){ $disableRelease = $disableMirror = $disableContinue = true; }elseif(empty($this->FAIdebianMirror)){ $disableRelease = $disableSection = true; }else{ $disableRelease = $disableSection = true; } /* check servers matching release and section settings */ $availableServer = array(); foreach($this->mirrors as $mir){ /* Check if release and section match */ if($mir['release'] == $this->FAIdebianRelease){ $pass = true; foreach($this->FAIdebianSection as $sec){ /* If a mirror match, attach */ if($sec != $mir['section']){ $pass = false; } /* Save all matching */ if($pass){ $availableServer[$mir['mirror']]=$mir['mirror']; } } } } /* If no servers matching the settings, allow setting release and section again */ if(($disableMirror==false)&&(count($availableServer)==0)){ $this->FAIdebianRelease = $this->FAIdebianMirror = ""; $this->FAIdebianSection = array(); $disableSection = $disableMirror = $disableContinue = true; $disableRelease = false; } /* Create checkboxes for the avaliable sections */ $strsec = "
".$sec." | "; }else{ $strsec .= "".$sec." | "; } } } $strsec .= "