Code

Better gray out
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Oct 2005 10:21:15 +0000 (10:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Oct 2005 10:21:15 +0000 (10:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1533 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPackage.inc

index de42cecfb929b592940532a6697e304d723fe129..ac0c81a4487abc46e4b30b6e3a04c71b67e40bdb 100644 (file)
@@ -100,6 +100,7 @@ class faiPackage extends plugin
 
     if(empty($this->FAIdebianRelease)){
       $disableSection = $disableMirror  = $disableOptions = true;
+      $this->sections=array("---");
     }elseif(empty($this->FAIdebianSection)){
       $disableRelease = $disableMirror  = $disableOptions = true;
     }elseif(empty($this->FAIdebianMirror)){
@@ -108,6 +109,25 @@ class faiPackage extends plugin
       $disableRelease = $disableSection =  true;
     }
 
+    $this->genMirror();
+
+    $availableServer = array();
+    foreach($this->mirrors as $mir){
+      if(($mir['release'] == $this->FAIdebianRelease)&&($mir['section']==$this->FAIdebianSection)){
+        $availableServer[$mir['mirror']]=$mir['mirror'];
+      }
+    }
+
+    if(($disableMirror==false)&&(count($availableServer)==0)){
+      $this->FAIdebianRelease = $this->FAIdebianSection = $this->FAIdebianMirror = "";
+      $disableSection = $disableMirror  = $disableOptions = true;
+      $disableRelease = false;
+    }
+
+    if(count($availableServer)==0){
+      $availableServer=array("---");
+    }
+
     $smarty->assign("ReleaseACL"  , "");
     $smarty->assign("MirrorACL"   , "");
     $smarty->assign("OptionACL"   , "");
@@ -126,19 +146,6 @@ class faiPackage extends plugin
       $smarty->assign("SectionACL"," disabled ");
     } 
 
-    $this->genMirror();
-
-    $availableServer = array();
-    foreach($this->mirrors as $mir){
-      if(($mir['release'] == $this->FAIdebianRelease)&&($mir['section']==$this->FAIdebianSection)){
-        $availableServer[$mir['mirror']]=$mir['mirror'];
-      }
-    }
-
-    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;
@@ -166,6 +173,21 @@ class faiPackage extends plugin
         $this->is_dialog=false;
       }
     }
+
+    if(isset($_POST['Conpkg'])){
+      $this->dialog = new faiPackageConfiguration($this->config, $this->dn,"none");
+      $this->is_dialog =true;
+    }
+   
+    if(isset($_POST['SaveObjectConfig'])){
+      $this->dialog = false;
+      $this->is_dialog=false;
+    }
+     
+    if(isset($_POST['CancelObjectConfig'])){
+      $this->dialog = false;
+      $this->is_dialog=false;
+    }
  
     if($this->is_dialog){
       return $this->dialog->execute();
@@ -217,14 +239,8 @@ class faiPackage extends plugin
                   $this->sections[$section]=$section;
 
                   if(empty($this->FAIdebianRelease)){
-                    $this->servers= array("---");
-                  }
-                  if(empty($this->FAIdebianSection)){
-                    $this->releases= array("---");
+                    $this->sections= array("---");
                   }
-                  if(empty($this->FAIdebianSection)){
-                    $this->FAIdebianSection = $section;
-                  }                    
 
                   $arr=array();
                   $arr['mirror'] = $mirror;