From 4c94f7b87e07a5e7b30523eb0b968e7628222eb6 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 6 Oct 2005 13:09:20 +0000 Subject: [PATCH] Better Repository selection, not ready yet... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1513 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPackage.inc | 59 +++++++++++++++++--------- plugins/admin/fai/faiPackage.tpl | 18 ++++---- 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index 2e44d8c33..aef188eb9 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -42,8 +42,6 @@ class faiPackage extends plugin var $releases = array(); // All possible releases var $sections = array(); // All section types - var $disableRepository = false; - var $mirrors = array(); // The combination of server/release/section var $confDir = ""; var $usedPackages = array(); @@ -61,10 +59,6 @@ class faiPackage extends plugin $this->dn =$dn; } - if(isset($this->attrs['FAIdebianSection'])){ - $this->disableRepository=true; - } - if(isset($this->attrs['FAIpackage'])){ unset($this->attrs['FAIpackage']['count']); foreach($this->attrs['FAIpackage'] as $pkg){ @@ -88,6 +82,33 @@ class faiPackage extends plugin $smarty->assign($attrs,$this->$attrs); } + $disableRelease = false; + $disableMirror = false; + $disableOptions = false; + /* Gray out handling */ + if(empty($this->FAIdebianSection)){ + $disableRelease = $disableMirror = $disableOptions = true; + }else + if(empty($this->FAIdebianRelease)){ + $disableMirror = $disableOptions = true; + }else + if(empty($this->FAIdebianMirror)){ + $disableOptions = true; + } + + $smarty->assign("ReleaseACL", ""); + $smarty->assign("MirrorACL", ""); + if($disableOptions){ + $smarty->assign("OptionACL"," disabled "); + }else{ + $smarty->assign("OptionACL", ""); + } + if($disableRelease){ + $smarty->assign("ReleaseACL"," disabled "); + } + if($disableMirror){ + $smarty->assign("MirrorACL"," disabled "); + } $this->genMirror(); $availableServer = array(); @@ -97,6 +118,10 @@ class faiPackage extends plugin } } + if($disableMirror){ + $availableServer[$mir['mirror']]=array("---"); + } + if(isset($_POST['Addpkg'])){ $this->dialog = new faiPackageEntry($this->config, $this->dn,$this->confDir.$this->FAIdebianMirror."/".$this->FAIdebianRelease."/".$this->FAIdebianSection,$this->usedPackages); $this->is_dialog =true; @@ -122,7 +147,6 @@ class faiPackage extends plugin $this->usedPackages = $use; $this->dialog = false; $this->is_dialog=false; - $this->disableRepository =true; } } @@ -130,15 +154,6 @@ class faiPackage extends plugin return $this->dialog->execute(); } - if($this->disableRepository == true){ - $smarty->assign("mirrorACL" ," disabled "); - $smarty->assign("releaseACL" ," disabled "); - $smarty->assign("sectionACL" ," disabled "); - }else{ - $smarty->assign("mirrorACL" ,""); - $smarty->assign("releaseACL" ,""); - $smarty->assign("sectionACL" ,""); - } $smarty->assign("mirrors" ,$availableServer); $smarty->assign("mirror" ,$this->FAIdebianMirror); $smarty->assign("releases",$this->releases); @@ -159,6 +174,10 @@ class faiPackage extends plugin /* Try to catch all available mirrors Possibly check if each server is reachable */ + + $this->servers= array(); + $this->releases=array(); + $this->sections=array(); $this->mirrors= array(); $fd = opendir($confDir); while($mirror = readdir($fd)){ @@ -180,11 +199,11 @@ class faiPackage extends plugin $this->releases[$release]=$release; $this->sections[$section]=$section; - if(empty($this->FAIdebianMirror)){ - $this->FAIdebianMirror= $mirror; - } if(empty($this->FAIdebianRelease)){ - $this->FAIdebianRelease = $release; + $this->servers= array("---"); + } + if(empty($this->FAIdebianSection)){ + $this->releases= array("---"); } if(empty($this->FAIdebianSection)){ $this->FAIdebianSection = $section; diff --git a/plugins/admin/fai/faiPackage.tpl b/plugins/admin/fai/faiPackage.tpl index 6ad8acb45..074601a28 100644 --- a/plugins/admin/fai/faiPackage.tpl +++ b/plugins/admin/fai/faiPackage.tpl @@ -35,10 +35,10 @@ - {html_options options=$sections selected=$section} - + @@ -48,10 +48,10 @@ - {html_options options=$releases selected=$release} - + @@ -61,10 +61,10 @@ - {html_options options=$mirrors selected=$mirror} - + @@ -80,9 +80,9 @@ {html_options options=$usedPackages}
- - - + + + -- 2.30.2