Merge branch 'MDL-36472-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2013-02-05 01:28:35 +01:00
6 changed files with 26 additions and 20 deletions
+2 -2
View File
@@ -349,8 +349,8 @@ $string['listupdatefail'] = 'DB operation failed when editing list hierarchy';
$string['logfilenotavailable'] = 'Logs not available';
$string['loginasnoenrol'] = 'You cannot use enrol or unenrol when in course "Login as" session';
$string['loginasonecourse'] = 'You cannot enter this course.<br /> You have to terminate the "Login as" session before entering any other course.';
$string['maxbytes'] = 'This file is bigger than the maximum size';
$string['maxareabytes'] = 'Not enough available space to store this file';
$string['maxbytes'] = 'The file is larger than the maximum size allowed.';
$string['maxareabytes'] = 'The file is larger than the space remaining in this area.';
$string['messagingdisable'] = 'Messaging is disabled on this site';
$string['mimetexisnotexist'] = 'Your system is not configured to run mimeTeX. You need to download the appropriate executable for you PHP_OS platform from <a href="http://moodle.org/download/mimetex/">http://moodle.org/download/mimetex/</a>, or obtain the C source from <a href="http://www.forkosh.com/mimetex.zip"> http://www.forkosh.com/mimetex.zip</a>, compile it and put the executable into your moodle/filter/tex/ directory.';
$string['mimetexnotexecutable'] = 'Custom mimetex is not executable!';
+8 -6
View File
@@ -986,21 +986,23 @@ $string['manageroles'] = 'Roles and permissions';
$string['markedthistopic'] = 'This topic is highlighted as the current topic';
$string['markthistopic'] = 'Highlight this topic as the current topic';
$string['matchingsearchandrole'] = 'Matching \'{$a->search}\' and {$a->role}';
$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
$string['maxsizeandattachmentsandareasize'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}, overall limit: {$a->areasize}';
$string['maxsizeandareasize'] = 'Maximum size for new files: {$a->size}, overall limit: {$a->areasize}';
$string['maxareabytesreached'] = 'The file (or the total size of several files) is larger than the space remaining in this area.';
$string['maxbytesforfile'] = 'The file {$a} is larger than the maximum size allowed.';
$string['maxfilesize'] = 'Maximum size for new files: {$a}';
$string['maxfilesreached'] = 'You are allowed to attach a maximum of {$a} file(s) to this item';
$string['maximumchars'] = 'Maximum of {$a} characters';
$string['maximumgrade'] = 'Maximum grade';
$string['maximumgradex'] = 'Maximum grade: {$a}';
$string['maximumchars'] = 'Maximum of {$a} characters';
$string['maximumshort'] = 'Max';
$string['maximumupload'] = 'Maximum upload size';
$string['maximumupload_help'] = 'This setting determines the largest size of file that can be uploaded to the course, limited by the site-wide setting set by an administrator. Activity modules also include a maximum upload size setting for further restricting the file size.';
$string['maxnumberweeks'] = 'Maximum for number of weeks/topics';
$string['maxnumberweeks_desc'] = 'This controls the maximum options that appears in the "Number of weeks/topics" setting for courses.';
$string['maxsize'] = 'Max size: {$a}';
$string['maxfilesize'] = 'Maximum size for new files: {$a}';
$string['maxnumcoursesincombo'] = 'Browse <a href="{$a->link}">{$a->numberofcourses} courses</a>.';
$string['maxsize'] = 'Max size: {$a}';
$string['maxsizeandareasize'] = 'Maximum size for new files: {$a->size}, overall limit: {$a->areasize}';
$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
$string['maxsizeandattachmentsandareasize'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}, overall limit: {$a->areasize}';
$string['memberincourse'] = 'People in the course';
$string['messagebody'] = 'Message body';
$string['messagedselectedusers'] = 'Selected users have been messaged and the recipient list has been reset.';
+3 -3
View File
@@ -582,8 +582,8 @@ M.form_dndupload.init = function(Y, options) {
var i;
for (i=0; i<files.length; i++) {
if (this.options.maxbytes > 0 && files[i].size > this.options.maxbytes) {
// Check filesize before attempting to upload
this.print_msg(M.util.get_string('uploadformlimit', 'moodle', files[i].name), 'error');
// Check filesize before attempting to upload.
this.print_msg(M.util.get_string('maxbytesforfile', 'moodle', files[i].name), 'error');
this.uploadqueue = []; // No uploads if one file is too big.
return;
}
@@ -626,7 +626,7 @@ M.form_dndupload.init = function(Y, options) {
if (sizereached > this.options.areamaxbytes) {
this.uploadqueue = [];
this.renamequeue = [];
this.print_msg(M.util.get_string('uploadformlimit', 'moodle', file.name), 'error');
this.print_msg(M.util.get_string('maxareabytesreached', 'moodle'), 'error');
return false;
}
}
+4 -1
View File
@@ -449,7 +449,10 @@ class page_requirements_manager {
$module = array('name' => 'core_dndupload',
'fullpath' => '/lib/form/dndupload.js',
'requires' => array('node', 'event', 'json', 'core_filepicker'),
'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'), array('dndenabled_inbox', 'moodle'), array('fileexists', 'moodle')));
'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'),
array('dndenabled_inbox', 'moodle'), array('fileexists', 'moodle'), array('maxbytesforfile', 'moodle'),
array('maxareabytesreached', 'moodle')
));
break;
}
+5 -5
View File
@@ -302,16 +302,16 @@ switch ($action) {
die(json_encode($err));
}
// Check if we exceed the max bytes of the area.
if (file_is_draft_area_limit_reached($itemid, $areamaxbytes, filesize($downloadedfile['path']))) {
throw new file_exception('maxareabytes');
}
// Check if exceed maxbytes.
if ($maxbytes != -1 && filesize($downloadedfile['path']) > $maxbytes) {
throw new file_exception('maxbytes');
}
// Check if we exceed the max bytes of the area.
if (file_is_draft_area_limit_reached($itemid, $areamaxbytes, filesize($downloadedfile['path']))) {
throw new file_exception('maxareabytes');
}
$info = repository::move_to_filepool($downloadedfile['path'], $record);
if (empty($info)) {
$info['e'] = get_string('error', 'moodle');
+4 -3
View File
@@ -195,13 +195,14 @@ class repository_upload extends repository {
$record->itemid = 0;
}
if (($maxbytes!==-1) && (filesize($_FILES[$elname]['tmp_name']) > $maxbytes)) {
throw new file_exception('maxbytes');
}
if (file_is_draft_area_limit_reached($record->itemid, $areamaxbytes, filesize($_FILES[$elname]['tmp_name']))) {
throw new file_exception('maxareabytes');
}
if (($maxbytes!==-1) && (filesize($_FILES[$elname]['tmp_name']) > $maxbytes)) {
throw new file_exception('maxbytes');
}
$record->contextid = $context->id;
$record->userid = $USER->id;