This also has a couple of bugfixes:
- file_info_context_system::get_children() was looking for courses with parent=0, it is impossible, block removed;
- file_info_context_coursecat::get_area_coursecat_description() was checking the wrong capability to view files in description
When clicking on 'Restore' next to a file in the 'Course
backup area' in the system context the message 'Sorry,
the requested file could not be found' was displayed.
This fix adds missing functionality to the class
'file_info_context_system' so that the file information
is correctly returned.
- Removed 'Private files' from 'Server files' repository;
- Show only non-empty directories (taking into account filetype filter);
- If there is only one non-empty filearea within a module, do not show it and skip the extra subdirectory level;
- If the user is not admin (does not have 'moodle/course:update' capability in system context), do not show course categories, just list available courses;
- Also when retrieving the course files capability to managefiles is checked before retrieving the modules list for performance tuning on sites with a lot of courses