mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
removed a slow call from restore code, this is a trouble maker if you have a lot of courses.
This commit is contained in:
parent
eedae98ef2
commit
3c13c1eacc
1 changed files with 3 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue