From f9b7a68bc23d947966da8c734463e30781ce50bb Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 16 May 2011 07:55:26 +0000 Subject: [PATCH] Updated partition size label, show growing or maxSize definitions. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20830 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Device/class_AddPartitionDialog.inc | 3 --- .../systems/goto/Device/class_DevicePartition.inc | 14 ++++++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc index 5be549117..98957ce9d 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc @@ -470,9 +470,6 @@ class AddPartitionDialog @$this->partitionObject->addPartition($target,$size, $maxSize, $grow, $format, $boot, $primary, $fsType, $fsOptions , $encrypt, $passphrase, $disk); - print_a(array($target,$size, $maxSize, $grow, $format, $boot, $primary, - $fsType, $fsOptions , $encrypt, $passphrase, $disk)); - // Display potential errors if(!$this->partitionObject->success()){ $msg = sprintf(_("Failed to add '%s': %s"), _("Partition"), $this->partitionObject->getError()); 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 a8e6da20c..2c8c93939 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc @@ -315,7 +315,7 @@ class DevicePartition $lData[] = array("data" => array( $str, $target, - $this->__convertPartSize($part['size']), + $this->__convertPartSize($part['size'], $part['grow'], $part['maxSize']), $device, $fsType, $part['fsOptions'], @@ -385,10 +385,16 @@ class DevicePartition /*! \brief Convert a given size value to a human readable format. */ - function __convertPartSize($size) + function __convertPartSize($size, $grow = False, $maxSize = NULL) { - $label = _("MB"); - return($size." ".$label); + $str = $size." "._("MB"); + + if($maxSize != NULL){ + $str .= " - ".$this->__convertPartSize($maxSize); + }elseif($grow){ + $str .= " - ... ("._("growing").")"; + } + return($str); } } -- 2.30.2