From: hickert Date: Thu, 20 Oct 2005 07:52:40 +0000 (+0000) Subject: Gray out preserved partitions X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1baab4eb6f9e84efe3be655942a898d80165e0f;p=gosa.git Gray out preserved partitions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1629 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc index fea90b82d..9b21944a9 100644 --- a/plugins/admin/fai/class_faiPartitionTableEntry.inc +++ b/plugins/admin/fai/class_faiPartitionTableEntry.inc @@ -129,7 +129,6 @@ class faiPartitionTableEntry extends plugin $this->partitions = $tmp; } - /* To add a partitions we only append an empty * array to the already defined partitions. */ @@ -191,10 +190,16 @@ class faiPartitionTableEntry extends plugin * To be able to check the posts later, we append a key to each single postfield. like cn_1 ... cn_2 */ foreach($this->partitions as $key => $part){ + + $dis = ""; + if($part['FAIpartitionFlags'] == "preserve"){ + $dis = " disabled "; + } + if($part['status']!="delete"){ /* Generate Partition select box */ - $PartitionType = ""; foreach($PartitionTypes as $type){ if($part['FAIpartitionType'] == $type){ $PartitionType .=""; @@ -207,7 +212,7 @@ class faiPartitionTableEntry extends plugin /* Generate fsType select box */ - $FAIfsType= ""; foreach($FAIfsTypes as $type){ if($part['FAIfsType'] == $type){ $FAIfsType .=""; @@ -217,20 +222,29 @@ class faiPartitionTableEntry extends plugin } $FAIfsType.=""; - $str .= ""; - $str .= "".$PartitionType.""; - $str .= "".$FAIfsType.""; - $str .= ""; - $str .= ""; - $str .= ""; - $str .= ""; + $str .= "\n"; + $str .= "\n".$PartitionType.""; + $str .= "\n".$FAIfsType.""; + $str .= "\n"; + $str .= "\n"; + $str .= "\n"; + $str .= "\n"; + + $changeState = "onClick=\"changeState('FAImountPoint_".$key."') ; ". + "changeState('FAIpartitionSize_".$key."') ; ". + "changeState('FAImountOptions_".$key."') ; ". + "changeState('FAIpartitionType_".$key."') ; ". + "changeState('FAIfsType_".$key."') ; ". + "changeState('FAIfsOptions_".$key."') ; \""; + + if($part['FAIpartitionFlags']!=false){ - $str .= ""; + $str .= "\n"; }else{ - $str .= ""; + $str .= "\n"; } - $str .= ""; - $str .= ""; + $str .= "\n"; + $str .= "\n"; } } $str.=""; @@ -310,7 +324,15 @@ class faiPartitionTableEntry extends plugin } foreach($this->partitions as $key => $part){ - + + /* Skip all checks, if preserve is set */ + if($part['FAIpartitionFlags'] == "preserve"){ + $this->partitions[$key]['FAIpartitionType'] = "preserve"; + $this->partitions[$key]['FAIfsType'] = "preserve"; + $this->partitions[$key]['FAIpartitionSize'] = "preserve"; + continue; + } + if((in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){ $message[]=sprintf(_("please enter a unique mount point for partition %s"),($key)); }