NOBUG workshop - added support for forgotten workshop_instructreviewers filearea

This commit is contained in:
David Mudrak 2010-05-18 17:55:06 +00:00
parent adf176d711
commit 94ad199baa
2 changed files with 3 additions and 21 deletions

View File

@ -34,6 +34,7 @@ $string['allocationerror'] = 'Allocation error';
$string['allsubmissions'] = 'All submissions';
$string['alreadygraded'] = 'Already graded';
$string['areainstructauthors'] = 'Instructions for submitting';
$string['areainstructreviewers'] = 'Instructions for assessing';
$string['areasubmissionattachment'] = 'Submission attachments';
$string['areasubmissioncontent'] = 'Submission texts';
$string['assess'] = 'Assess';

View File

@ -412,6 +412,7 @@ function workshop_get_file_areas($course, $cm, $context) {
$areas = array();
if (has_capability('moodle/course:managefiles', $context)) {
$areas['workshop_instructauthors'] = get_string('areainstructauthors', 'workshop');
$areas['workshop_instructreviewers'] = get_string('areainstructreviewers', 'workshop');
$areas['workshop_submission_content'] = get_string('areasubmissioncontent', 'workshop');
$areas['workshop_submission_attachment'] = get_string('areasubmissionattachment', 'workshop');
}
@ -618,27 +619,7 @@ function workshop_get_file_info($browser, $areas, $course, $cm, $context, $filea
return new file_info_stored($browser, $context, $storedfile, $urlbase, $topvisiblename, true, true, false, false);
}
/* todo was replaced by subplugins' areas
if ($filearea === 'workshop_dimension_description') {
// always only itemid 0 - TODO not true, review
$filepath = is_null($filepath) ? '/' : $filepath;
$filename = is_null($filename) ? '.' : $filename;
$urlbase = $CFG->wwwroot.'/pluginfile.php';
if (!$storedfile = $fs->get_file($context->id, $filearea, 0, $filepath, $filename)) {
if ($filepath === '/' and $filename === '.') {
$storedfile = new virtual_root_file($context->id, $filearea, 0);
} else {
// not found
return null;
}
}
return new file_info_stored($browser, $context, $storedfile, $urlbase, $areas[$filearea], false, true, true, false);
}
*/
if ($filearea === 'workshop_instructauthors') {
if ($filearea == 'workshop_instructauthors' or $filearea == 'workshop_instructreviewers') {
// always only itemid 0
$filepath = is_null($filepath) ? '/' : $filepath;