Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…dle into MOODLE_21_STABLE
  • Loading branch information...
commit b693256a99db59768964ee60985df116f348d72a 2 parents f3ab1e0 + 6819bed
@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
@@ -3778,7 +3778,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.