mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-59954 mod_course: Remove file size restriction on D&D on course page
Remove file size restrictions for teachers on course page. Use user_max_upload_file_size instead of the max_file_size
This commit is contained in:
parent
33a388eff7
commit
6afbdf2778
@ -744,7 +744,7 @@ M.course_dndupload = {
|
||||
var xhr = new XMLHttpRequest();
|
||||
var self = this;
|
||||
|
||||
if (file.size > this.maxbytes) {
|
||||
if (this.maxbytes > 0 && file.size > this.maxbytes) {
|
||||
new M.core.alert({message: M.util.get_string('namedfiletoolarge', 'moodle', {filename: file.name})});
|
||||
return;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ function dndupload_add_to_course($course, $modnames) {
|
||||
);
|
||||
$vars = array(
|
||||
array('courseid' => $course->id,
|
||||
'maxbytes' => get_max_upload_file_size($CFG->maxbytes, $course->maxbytes),
|
||||
'maxbytes' => get_user_max_upload_file_size($PAGE->context, $CFG->maxbytes, $course->maxbytes),
|
||||
'handlers' => $handler->get_js_data(),
|
||||
'showstatus' => $showstatus)
|
||||
);
|
||||
@ -488,7 +488,7 @@ class dndupload_ajax_processor {
|
||||
|
||||
// Add the file to a draft file area.
|
||||
$draftitemid = file_get_unused_draft_itemid();
|
||||
$maxbytes = get_max_upload_file_size($CFG->maxbytes, $this->course->maxbytes);
|
||||
$maxbytes = get_user_max_upload_file_size($this->context, $CFG->maxbytes, $this->course->maxbytes);
|
||||
$types = $this->dnduploadhandler->get_handled_file_types($this->module->name);
|
||||
$repo = repository::get_instances(array('type' => 'upload', 'currentcontext' => $this->context));
|
||||
if (empty($repo)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user