MDL-44725 Availability: Replace groupmembersonly - core_availability (2)

Remove groupmembersonly usage in the core_availability API, and change
the update code (used in backup) so that it considers groupmembersonly
when restoring old backups.
This commit is contained in:
sam marshall
2014-09-02 13:03:09 +01:00
parent 061e6b2864
commit 3d962d49cb
5 changed files with 13 additions and 49 deletions
@@ -79,14 +79,6 @@ class frontend extends \core_availability\frontend {
\section_info $section = null) {
global $CFG;
// If groupmembersonly is turned on, then you can only add group
// restrictions on sections (which don't use groupmembersonly) and
// not on modules. This is to avoid confusion - otherwise
// there would be two ways to add restrictions based on groups.
if (is_null($section) && $CFG->enablegroupmembersonly) {
return false;
}
// Only show this option if there are some groups.
return count($this->get_all_groups($course->id)) > 0;
}