}
//Now, select the course if needed
- //if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
- if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0)) {
+ //if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0) and get_capability_courses('moodle/site:restore')) {
+ if (($restore->restoreto == 0 or $restore->restoreto == 1) and ($restore->course_id == 0)) {
if ($courses = get_courses("all","c.fullname","c.id,c.fullname,c.shortname,c.visible")) {
print_heading(get_string("choosecourse"));
* newcourse
*/
- $mycourses = get_capability_courses('moodle/course:restore');
+ $mycourses = get_capability_courses('moodle/site:restore');
// if the user can manage 2 or more courses,
// or if the only course the user can manage is not the current course
$restore_restoreto_options[0] = get_string("existingcoursedeleting");
$restore_restoreto_options[1] = get_string("existingcourseadding");
// else if the user can write to current course
- } else if (has_capability('moodle/course:restore', get_context_instance(CONTEXT_COURSE, $id))){
+ } else if (has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $id))){
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
$restore_restoreto_options[1] = get_string("currentcourseadding");
}