From 96183352b291f6d3371f4399e6c1b45bbb78aef8 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 13 May 2011 14:45:19 +0000 Subject: [PATCH] Added comments and made size human readable git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20826 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Device/class_DevicePartition.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 d5a074bf1..5b975365d 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc @@ -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); } } -- 2.30.2