From 3c13c1eaccde105bef71f72f8a861f5b0cbdaf7c Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 20 Sep 2007 08:58:12 +0000 Subject: [PATCH] removed a slow call from restore code, this is a trouble maker if you have a lot of courses. --- backup/restore_form.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backup/restore_form.html b/backup/restore_form.html index 1736606c31..92b1d963fe 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -194,12 +194,13 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { * newcourse */ - $mycourses = get_capability_courses('moodle/site: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 // we show options for existing courses - if (count($mycourses) > 1 || !in_array($id, $mycourses)) { + if (user_can_create_courses()) { // this is not entirely accurate but much faster + //if (count($mycourses) > 1 || !in_array($id, $mycourses)) { // if user can manage more than 1 course, or if user can restore to a single different course $restore_restoreto_options[0] = get_string("existingcoursedeleting"); $restore_restoreto_options[1] = get_string("existingcourseadding"); -- 2.39.5