Index: openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 9 Mar 2021 09:40:29 -0000 1.10.2.1 +++ openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 9 Mar 2021 09:45:12 -0000 1.10.2.2 @@ -1,6 +1,6 @@ ad_page_contract { - This page allows a file storage admin to change the + This page allows a file storage admin to change the upload size. @author Tracy Adams (teadams@mit.edu) @@ -9,13 +9,12 @@ } { {return_url:localurl ""} -} +} set title "#file-storage.Configure_File_Upload_Limit#" set context [list $title] # Get the webserver maximum file upload value. - # Set a conservative default value of 2GB if the maximum upload value is not # found in the webserver config. set driver [expr {[ns_conn isconnected] ? @@ -24,36 +23,34 @@ set section [ns_driversection -driver $driver] set max_size [ns_config $section maxinput 2147483648] - set upload_limit [fs::max_upload_size] ad_form -name upload_limit_size -export folder_id -form { - {new_size:integer(number) {label "#file-storage.Upload_Limit# $max_size"} {value $upload_limit} {html { min 0 max $max_size }}} - {return_url:text(hidden) {value $return_url}} - {submit:text(submit) {label "[_ file-storage.Change_upload_limit]"}} + {new_size:integer(number) + {label "#file-storage.Upload_Limit# $max_size"} + {value $upload_limit} + {html { min 0 max $max_size }} + } + {return_url:text(hidden) + {value $return_url} + } + {submit:text(submit) + {label "[_ file-storage.Change_upload_limit]"} + } } -validate { - {new_size - { $max_size == 0 || $new_size <= $max_size } - "#file-storage.Upload_limit_error# $max_size #file-storage.Upload_limit_error_2# "} - + {new_size + { $new_size <= $max_size } + "#file-storage.Upload_limit_error# $max_size \ + #file-storage.Upload_limit_error_2# " + } } -on_submit { parameter::set_value -parameter "MaximumFileSize" -value $new_size if {$return_url ne ""} { - ad_returnredirect $return_url + ad_returnredirect $return_url ad_script_abort } } - - - - - - - - - - # Local variables: # mode: tcl # tcl-indent-level: 4