From 6eeb169ac2d28ad1d992c8fcf556ef7dd9bdba8c Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 7 Oct 2005 04:56:09 +0000 Subject: [PATCH] Better gray out handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1517 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPackage.inc | 54 +++++++++++++++++--------- plugins/admin/fai/faiPackage.tpl | 12 +++--- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index aef188eb9..de42cecfb 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -44,7 +44,7 @@ class faiPackage extends plugin var $mirrors = array(); // The combination of server/release/section var $confDir = ""; - var $usedPackages = array(); + var $usedPackages = array(); function faiPackage ($config, $dn= NULL) { @@ -65,7 +65,7 @@ class faiPackage extends plugin $this->usedPackages[$pkg] = $pkg; } }else{ - $this->usedPackages = array();; + $this->usedPackages = array(); } $this->confDir = CONFIG_DIR."/fai/"; $this->FAIpackage = array(); @@ -77,38 +77,55 @@ class faiPackage extends plugin $smarty= get_smarty(); $display= ""; + $disableRelease = false; + $disableMirror = false; + $disableOptions = false; + $disableSection = false; + /* Assign variables */ foreach($this->attributes as $attrs){ $smarty->assign($attrs,$this->$attrs); } - $disableRelease = false; - $disableMirror = false; - $disableOptions = false; - /* Gray out handling */ - if(empty($this->FAIdebianSection)){ - $disableRelease = $disableMirror = $disableOptions = true; - }else + /* Post handling for Section, Release and Mirror Setup */ + if(isset($_POST['SetSection'])){ + $this->FAIdebianSection = $_POST['FAIdebianSectionS']; + } + if(isset($_POST['SetRelease'])){ + $this->FAIdebianRelease = $_POST['FAIdebianReleaseS']; + } + if(isset($_POST['SetMirror'])){ + $this->FAIdebianMirror = $_POST['FAIdebianMirrorS']; + } + if(empty($this->FAIdebianRelease)){ - $disableMirror = $disableOptions = true; - }else - if(empty($this->FAIdebianMirror)){ - $disableOptions = true; + $disableSection = $disableMirror = $disableOptions = true; + }elseif(empty($this->FAIdebianSection)){ + $disableRelease = $disableMirror = $disableOptions = true; + }elseif(empty($this->FAIdebianMirror)){ + $disableRelease = $disableSection = $disableOptions = true; + }else{ + $disableRelease = $disableSection = true; } - - $smarty->assign("ReleaseACL", ""); - $smarty->assign("MirrorACL", ""); + + $smarty->assign("ReleaseACL" , ""); + $smarty->assign("MirrorACL" , ""); + $smarty->assign("OptionACL" , ""); + $smarty->assign("SectionACL" , ""); + if($disableOptions){ $smarty->assign("OptionACL"," disabled "); - }else{ - $smarty->assign("OptionACL", ""); } if($disableRelease){ $smarty->assign("ReleaseACL"," disabled "); } if($disableMirror){ $smarty->assign("MirrorACL"," disabled "); + } + if($disableSection){ + $smarty->assign("SectionACL"," disabled "); } + $this->genMirror(); $availableServer = array(); @@ -244,6 +261,7 @@ class faiPackage extends plugin */ function save_object() { + plugin::save_object(); foreach($this->attributes as $attrs){ if(isset($_POST[$attrs])){ diff --git a/plugins/admin/fai/faiPackage.tpl b/plugins/admin/fai/faiPackage.tpl index 78b738f80..4e8884cb2 100644 --- a/plugins/admin/fai/faiPackage.tpl +++ b/plugins/admin/fai/faiPackage.tpl @@ -35,10 +35,10 @@ - {html_options options=$releases selected=$release} - + @@ -48,10 +48,10 @@ - {html_options options=$sections selected=$section} - + @@ -61,10 +61,10 @@ - {html_options options=$mirrors selected=$mirror} - + -- 2.30.2