mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-33766 files: Capability to ignore userquota
This commit is contained in:
parent
21e3ea77a3
commit
380c122fe2
2 changed files with 15 additions and 1 deletions
|
@ -51,10 +51,15 @@ $PAGE->set_heading($title);
|
|||
$PAGE->set_pagelayout('mydashboard');
|
||||
$PAGE->set_pagetype('user-files');
|
||||
|
||||
$maxareabytes = $CFG->userquota;
|
||||
if (has_capability('moodle/user:ignoreuserquota', $context)) {
|
||||
$maxareabytes = -1;
|
||||
}
|
||||
|
||||
$data = new stdClass();
|
||||
$data->returnurl = $returnurl;
|
||||
$options = array('subdirs' => 1, 'maxbytes' => $CFG->userquota, 'maxfiles' => -1, 'accepted_types' => '*',
|
||||
'areamaxbytes' => $CFG->userquota);
|
||||
'areamaxbytes' => $maxareabytes);
|
||||
file_prepare_standard_filemanager($data, 'files', $options, $context, 'user', 'private', 0);
|
||||
|
||||
$mform = new user_files_form(null, array('data'=>$data, 'options'=>$options));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue