Code

Added comments and made size human readable
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 May 2011 14:45:19 +0000 (14:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 May 2011 14:45:19 +0000 (14:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20826 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index d5a074bf14fa4eeb8dfb91daf0115792ef826984..5b975365d8106f568257ddf6d306fb5b97b371a9 100644 (file)
@@ -342,6 +342,9 @@ class DevicePartition
         return($smarty->fetch(get_template_path('goto/Device/DevicePartition.tpl', TRUE)));
     }
 
+
+    /*! \brief  Keep posted HTML values and acts on remove requests.
+     */
     function save_object()
     {
         // Create a map whcih points to the correct remove method for each device.
@@ -370,14 +373,26 @@ class DevicePartition
         }
     }
 
+
+    /*! \brief  Returns to created partition table string, which can then be
+     *          saved back to the server.
+     */
     function save()
     {
         return($this->object->dump());
     }
 
+
+    /*! \brief  Convert a given size value to a human readable format.
+     */
     function __convertPartSize($size)
     {
-        return($size." MB");
+        $label = _("MB");
+        if($size%1024 == 0){
+            $size = $size/1024;
+            $label = _("GB");
+        }
+        return($size."".$label);
     }
 }