Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'wip-mdl-33159-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
commit ccbdbc7f67b02994cefe4af5c34a8d294afc144c 2 parents 59cc009 + 125840c
@nebgor nebgor authored
Showing with 8 additions and 1 deletion.
  1. +7 −0 course/edit.php
  2. +1 −1  course/lib.php
View
7 course/edit.php
@@ -85,6 +85,13 @@
//editor should respect category context if course context is not set.
$editoroptions['context'] = $catcontext;
$course = file_prepare_standard_editor($course, 'summary', $editoroptions, null, 'course', 'summary', null);
+
+ // Set up the default restricted module list
+ if (!empty($CFG->restrictbydefault)) {
+ if (!empty($CFG->defaultallowedmodules)) {
+ $course->allowedmods = explode(',', $CFG->defaultallowedmodules);
+ }
+ }
}
// first create the form
View
2  course/lib.php
@@ -3845,7 +3845,7 @@ function create_course($data, $editoroptions = NULL) {
fix_course_sortorder();
// update module restrictions
- if ($course->restrictmodules) {
+ if ($course->restrictmodules || $CFG->restrictbydefault ) {
if (isset($data->allowedmods)) {
update_restricted_mods($course, $data->allowedmods);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.