Code

Updated partition size label, show growing or maxSize definitions.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 07:55:26 +0000 (07:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 07:55:26 +0000 (07:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20830 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc
gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc

index 5be5491175d1f8f4f5a17195b38636d9ec53316d..98957ce9d64abaeba92a8ba6c6a940928357663c 100644 (file)
@@ -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());
index a8e6da20c0d307121a0407bafe91169eb09da4bf..2c8c939397c5ff60b31cc2f324e133a732fd9e70 100644 (file)
@@ -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 .= " - ...  <i>("._("growing").")</i>";
+        }
+        return($str);
     }
 }