From: hickert Date: Thu, 6 Aug 2009 09:33:57 +0000 (+0000) Subject: Updated FAI partition stuff. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2e346a4b2600a319a768266a449ab61a64aaf2ad;p=gosa.git Updated FAI partition stuff. -Displayed partition details are now more readable. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13978 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc index b8759f524..c319fc392 100644 --- a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc @@ -213,6 +213,15 @@ class faiDiskEntry extends plugin } } + /* Act on _GET edit request + */ + if(isset($_GET['act']) && $_GET['act'] == "editPart" && isset($_GET['id'])){ + $id = $_GET['id']; + if(isset($this->partitions[$id])){ + $this->dialog = new faiPartition($this->config,$this->partitions[$id], $this,$this->FAIdiskType); + } + } + /* Create a new partition for this disk. */ if(isset($_POST['AddPartition']) && !preg_match("/freeze/i",$this->FAIstate)){ @@ -437,42 +446,54 @@ class faiDiskEntry extends plugin $divlist = new divSelectBox("DiskEntries"); foreach($this->partitions as $key => $part){ + $cn =array( - "string" => $part['cn'], - "attach" => "style='width:20px;'"); + "string" => "".$part['cn']."", + "attach" => "style='width:160px;'"); + + $desc =array( + "string" => "". + $part['description']."", + "attach" => "style='width:200px;'"); + $number =array( "string" => $part['FAIpartitionNr'], "attach" => "style='width:20px;'"); $size =array( "string" => $part['FAIpartitionSize'], "attach" => "style='width:100px;'"); - $fstype =array( - "string" => $part['FAIfsType'], - "attach" => "style='width:60px;'"); $type =array( "string" => $part['FAIpartitionType'], "attach" => "style='width:80px;'"); + + $mnt = $part['FAImountPoint']; + if(preg_match("/:encrypt/", $mnt)){ + $mnt = preg_replace("/:encrypt/","",$mnt); + } + $mntp =array("string" => $mnt); + + $opt = ""; + if(isset($part['encrypted']) && $part['encrypted']){ + $opt.= " "._("encrypted").", "; + } + if(isset($part['bootable']) && $part['bootable']){ + $opt.= " "._("bootable").", "; + } + if(isset($part['preserve']) && $part['preserve']){ + $opt.= " "._("preserve").": ".$part['preserveType'].", "; + } $opt =array( - "string" => $part['FAImountOptions'], - "attach" => "style='width:80px;'"); - $fsopt =array( - "string" => $part['FAIfsOptions'], - "attach" => "style='width:80px;'"); - $flags =array( - "string" => $part['FAIpartitionFlags'], - "attach" => "style='width:80px;'"); - $mntp =array("string" => $part['FAImountPoint']); + "string" => "".preg_replace('/, $/',"",$opt).""); - $action =array( "string" => "". "", "attach" => "style='width:40px; border-right: 0px;'"); if($this->FAIdiskType == "lvm"){ - $fields = array($cn,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action); + $fields = array($cn,$desc,$mntp,$opt,$size, $action); }else{ - $fields = array($number,$type,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action); + $fields = array($number,$desc,$type,$mntp,$opt,$size,$action); } $divlist->AddEntry($fields); }