MDL-32638 fixing the area names and file_browser::get_file_info() API call

These two bug made the file browsing non-working in workshop 2.x
This commit is contained in:
David Mudrak 2012-04-26 11:55:25 +02:00
parent 7528e238e0
commit f08c15685b
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ class workshop_file_info_submissions_container extends file_info {
$itemids = $DB->get_records('files', array('contextid' => $this->context->id, 'component' => 'mod_workshop', 'filearea' => $this->filearea),
'itemid', "DISTINCT itemid");
foreach ($itemids as $itemid => $unused) {
if ($child = $this->browser->get_file_info($this->context, $this->filearea, $itemid)) {
if ($child = $this->browser->get_file_info($this->context, 'mod_workshop', $this->filearea, $itemid)) {
$children[] = $child;
}
}

View File

@ -1348,7 +1348,7 @@ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filea
$fs = get_file_storage();
if ($filearea === 'content' or $filearea === 'attachment') {
if ($filearea === 'submission_content' or $filearea === 'submission_attachment') {
if (!has_capability('mod/workshop:viewallsubmissions', $context)) {
return null;