Changeset 5071 in subversion
- Timestamp:
- Aug 16, 2011 8:11:21 AM (22 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (2 diffs)
-
program/js/app.js (modified) (1 diff)
-
program/steps/mail/compose.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r5055 r5071 2 2 =========================== 3 3 4 - Add client-side checking of uploaded files size 4 5 - Add newlines between organization, department, jobtitle (#1488028) 5 6 - Recalculate date when replying to a message and localize the cite header (#1487675) -
trunk/roundcubemail/program/include/main.inc
r5068 r5071 2333 2333 } 2334 2334 2335 function rcube_upload_ progress_init()2335 function rcube_upload_init() 2336 2336 { 2337 2337 global $RCMAIL; … … 2344 2344 } 2345 2345 } 2346 2347 // find max filesize value 2348 $max_filesize = parse_bytes(ini_get('upload_max_filesize')); 2349 $max_postsize = parse_bytes(ini_get('post_max_size')); 2350 if ($max_postsize && $max_postsize < $max_filesize) 2351 $max_filesize = $max_postsize; 2352 2353 $RCMAIL->output->set_env('max_filesize', $max_filesize); 2354 $max_filesize = show_bytes($max_filesize); 2355 $RCMAIL->output->set_env('filesizeerror', rcube_label(array( 2356 'name' => 'filesizeerror', 'vars' => array('size' => $max_filesize)))); 2357 2358 return $max_filesize; 2346 2359 } 2347 2360 -
trunk/roundcubemail/program/js/app.js
r5049 r5071 3254 3254 3255 3255 // get file input field, count files on capable browser 3256 var field = $('input[type=file]', form).get(0),3256 var i, size = 0, field = $('input[type=file]', form).get(0), 3257 3257 files = field.files ? field.files.length : field.value ? 1 : 0; 3258 3258 3259 3259 // create hidden iframe and post upload form 3260 3260 if (files) { 3261 // check file size 3262 if (field.files && this.env.max_filesize && this.env.filesizeerror) { 3263 for (i=0; i<files; i++) 3264 size += field.files[i].size; 3265 if (size && size > this.env.max_filesize) { 3266 this.display_message(this.env.filesizeerror, 'error'); 3267 return; 3268 } 3269 } 3270 3261 3271 var frame_name = this.async_upload_form(form, 'upload', function(e) { 3262 3272 var d, content = ''; -
trunk/roundcubemail/program/steps/mail/compose.inc
r5040 r5071 1207 1207 $attrib['id'] = 'rcmUploadbox'; 1208 1208 1209 // Enable upload progress bar 1210 rcube_upload_progress_init(); 1211 1212 // find max filesize value 1213 $max_filesize = parse_bytes(ini_get('upload_max_filesize')); 1214 $max_postsize = parse_bytes(ini_get('post_max_size')); 1215 if ($max_postsize && $max_postsize < $max_filesize) 1216 $max_filesize = $max_postsize; 1217 1218 $OUTPUT->set_env('max_filesize', $max_filesize); 1219 $max_filesize = show_bytes($max_filesize); 1220 1209 // Get filesize, enable upload progress bar 1210 $max_filesize = rcube_upload_init(); 1211 1221 1212 $button = new html_inputfield(array('type' => 'button')); 1222 1213 1223 1214 $out = html::div($attrib, 1224 1215 $OUTPUT->form_tag(array('name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'), … … 1231 1222 ) 1232 1223 ); 1233 1224 1234 1225 $OUTPUT->add_gui_object('uploadbox', $attrib['id']); 1235 1226 return $out;
Note: See TracChangeset
for help on using the changeset viewer.
