From: hickert Date: Fri, 13 May 2011 14:45:19 +0000 (+0000) Subject: Added comments and made size human readable X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=96183352b291f6d3371f4399e6c1b45bbb78aef8;p=gosa.git Added comments and made size human readable git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20826 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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); } }