if ($this->row['max_file_size'] == AT_FILESIZE_DEFAULT) { $f_def = ' checked="checked" '; $f_oth2 = ' disabled="disabled" '; } elseif ($this->row['max_file_size'] == AT_FILESIZE_SYSTEM_MAX) { $f_max = ' checked="checked" '; $f_oth2 = ' disabled="disabled" '; } else { $f_oth = ' checked="checked" '; $f_oth2 = ''; } ?> <input type="radio" id="f_default" name="filesize" value="<?php echo AT_FILESIZE_DEFAULT; ?>" onclick="disableOther2();" <?php echo $f_def;?> /><label for="f_default"> <?php echo _AT('default') . ' ('.get_human_size($MaxFileSize).')'; ?></label> <br /> <input type="radio" id="f_maxallowed" name="filesize" value="<?php echo AT_FILESIZE_SYSTEM_MAX; ?>" onclick="disableOther2();" <?php echo $f_max;?>/><label for="f_maxallowed"> <?php echo _AT('max_file_size_system') . ' ('.get_human_size($max_allowed).')'; ?></label> <br /> <input type="radio" id="f_other" name="filesize" value="2" onclick="enableOther2();" <?php echo $f_oth;?>/><label for="f_other"> <?php echo _AT('other'); ?> </label> - <label for="filesize_entered">Filesize entered</label> <input type="text" id="filesize_entered" name="filesize_entered" <?php echo $f_oth2?> value="<?php if ($this->row['max_file_size']!=AT_FILESIZE_DEFAULT && $this->row['max_file_size']!=AT_FILESIZE_SYSTEM_MAX) { echo bytes_to_megabytes($this->row['max_file_size']); } ?>" size="4" /> <?php echo _AT('mb'); ?> </div> <?php else: ?> <input type="hidden" name="quota" value="<?php echo $this->row['max_quota']; ?>" /> <input type="hidden" name="filesize" value="<?php echo $this->row['max_file_size']; ?>" /> <input type="hidden" name="tracking" value="<?php echo $this->row['tracking']; ?>" /> <?php endif; ?> <div class="row"> <label for="copyright"><?php echo _AT('course_copyright'); ?></label><br /> <textarea name="copyright" rows="2" cols="65" id="copyright"><?php echo $this->row['copyright']; ?></textarea> </div> <div class="row"> <?php if ($this->row['icon'] != ''):
?> </label> <br /> <input type="radio" id="f_other" name="filesize" value="2" onclick="enableOther2();" <?php echo $f_oth; ?> /><label for="f_other"> <?php echo _AT('other'); ?> </label> - <label for="filesize_entered">Filesize entered</label> <input type="text" id="filesize_entered" name="filesize_entered" <?php echo $f_oth2; ?> value="<?php if ($this->row['max_file_size'] != AT_FILESIZE_DEFAULT && $this->row['max_file_size'] != AT_FILESIZE_SYSTEM_MAX) { echo bytes_to_megabytes($this->row['max_file_size']); } ?> " size="4" /> <?php echo _AT('mb'); ?> </div> <?php } else { ?> <input type="hidden" name="quota" value="<?php echo $this->row['max_quota']; ?> " /> <input type="hidden" name="filesize" value="<?php
function get_human_size($num_bytes) { $abs_num_bytes = abs($num_bytes); if ($abs_num_bytes >= AT_KBYTE_SIZE * AT_KBYTE_SIZE) { return round(bytes_to_megabytes($num_bytes), 2) . ' ' . _AT('mb'); } else { if ($abs_num_bytes >= AT_KBYTE_SIZE) { return round(bytes_to_kilobytes($num_bytes), 2) . ' ' . _AT('kb'); } } // else: return $num_bytes . ' ' . _AT('bt'); }