MDL-24419 (4): Add conditional availability support to sections; section cache
Credit: original version done by Kirill Astashov of NetSpot (netspot.com.au), finished and tweaked by sam. This change adds conditional availability support for sections analagous to that already available for activities. (Backend, UI, backup/restore.) In order that this feature does not reduce performance, section cacheing has also been added using a new course 'sectioncache' field analagous to modinfo. The new feature integrates with activity availability so that activities inside sections which are not available are automatically not available themselves (meaning it works to restrict access).
This commit is contained in:
+4
-1
@@ -4641,7 +4641,10 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
|
||||
}
|
||||
$DB->update_record('course', $oldcourse);
|
||||
|
||||
// Delete course sections.
|
||||
// Delete course sections and availability options.
|
||||
$DB->delete_records_select('course_sections_availability',
|
||||
'coursesectionid IN (SELECT id from {course_sections} WHERE course=?)',
|
||||
array($course->id));
|
||||
$DB->delete_records('course_sections', array('course'=>$course->id));
|
||||
|
||||
// delete legacy, section and any other course files
|
||||
|
||||
Reference in New Issue
Block a user