summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b324ec)
raw | patch | inline | side by side (parent: 8b324ec)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 May 2011 13:23:21 +0000 (13:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 May 2011 13:23:21 +0000 (13:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20818 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc
index d955479b5719feee0839af0c8d94ca3ce9b78938..4c6ae408072143364ad56d8eed726190a2f2b0cc 100644 (file)
<?php
-
-
class DevicePartition
{
public $object =NULL;
$this->entryList->setWidth("100%");
$this->entryList->setHeight("400px");
$this->entryList->setHeader(array(_("Type"),_("Target"),_("Size"),_("Uses device")." / "._("Used by"),
- _("Filesystem"), _("Options"), _("Format"), "-"));
+ _("Filesystem"), _("Options"), _("Details"), "-"));
$this->entryList->setColspecs(array('*','*','*', '*'));
$this->entryList->setAcl('rwcdm');
$this->entryList->setReorderable(FALSE);
$lData[] = array("data" => array("<b>"._("Disks")."</b>"));
foreach($disks as $id => $disk){
$str = "{$seps[1]}{$diskImg} {$disk['device']}";
- $lData[] = array("data" => array($str));
+
+ // Create remove icon
+ $delImg = image('images/lists/trash.png', "delete_disk_{$id}", _("Remove disk"));
+ $lData[] = array("data" => array($str,"","","","","","", $delImg));
// Add partitions
foreach($partitions as $pid => $part){
$fsType = trim($fsType);
}
- $formatImg = ($part['format']) ? image('images/true.png') : "";
+ // Create property icons
+ $emptyImage = image("images/empty.png");
+ $formatImg = ($part['format']) ? image('plugins/goto/images/formatDisk.png','',_("Format partition")) : $emptyImage;
+ $primaryImg = ($part['primary']) ? image('plugins/goto/images/primary.png','',_("Primary partition")) : $emptyImage;
+ $encryptImg = ($part['encrypted']) ? image('images/lists/locked.png','',_("Encrypted")) : $emptyImage;
+
+ // Create remove icon
+ $delImg = image('images/lists/trash.png', "delete_part_{$pid}", _("Remove partition"));
// Add entry to the listing
$lData[] = array("data" => array(
$device,
$fsType,
$part['fsOptions'],
- $formatImg));
+ $primaryImg.$formatImg.$encryptImg,
+ $delImg));
}
}
}
function save_object()
{
-
+ foreach($_POST as $name => $value){
+
+ // Remove paritions
+ if(preg_match("/^delete_part_[0-9]*$/", $name)){
+ $id = preg_replace("/^delete_part_/i", "", $name) + 0;
+ @$this->object->delPartition($id);
+ if(!$this->object->success()){
+ $msg = sprintf(_("Failed to remove partition: %s"), $this->object->getError());
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
+ }
+ }
+
+ // Remove disks
+ if(preg_match("/^delete_disk_[0-9]*$/", $name)){
+ $id = preg_replace("/^delete_disk_/i", "", $name) + 0;
+ @$this->object->delDisk($id);
+ if(!$this->object->success()){
+ $msg = sprintf(_("Failed to remove disk: %s"), $this->object->getError());
+ msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
+ }
+ }
+ }
}
function save()