Skip to content

Commit

Permalink
Merge branch 'MDL-33074_groupmode_button' of git://github.com/davosmi…
Browse files Browse the repository at this point in the history
…th/moodle
  • Loading branch information
danpoltawski committed May 23, 2012
2 parents 5a5cdaf + 82d2a84 commit c14cad3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions course/dnduploadlib.php
Expand Up @@ -557,7 +557,13 @@ protected function create_course_module() {
}
// The following are used inside some few core functions, so may as well set them here.
$this->cm->coursemodule = $this->cm->id;
$this->cm->groupmodelink = (!$this->course->groupmodeforce);
$groupbuttons = ($this->course->groupmode or (!$this->course->groupmodeforce));
if ($groupbuttons and plugin_supports('mod', $this->module->name, FEATURE_GROUPS, 0)) {
$this->cm->groupmodelink = (!$this->course->groupmodeforce);
} else {
$this->cm->groupmodelink = false;
$this->cm->groupmode = false;
}
}

/**
Expand Down Expand Up @@ -619,6 +625,8 @@ protected function finish_setup_course_module($instanceid) {
throw new moodle_exception('errorcreatingactivity', 'moodle', '', $this->module->name);
}
$mod = $info->cms[$this->cm->id];
$mod->groupmodelink = $this->cm->groupmodelink;
$mod->groupmode = $this->cm->groupmode;

// Trigger mod_created event with information about this module.
$eventdata = new stdClass();
Expand All @@ -636,12 +644,6 @@ protected function finish_setup_course_module($instanceid) {
"view.php?id=$mod->id",
"$instanceid", $mod->id);

if ($this->cm->groupmodelink && plugin_supports('mod', $mod->modname, FEATURE_GROUPS, 0)) {
$mod->groupmodelink = $this->cm->groupmodelink;
} else {
$mod->groupmodelink = false;
}

$this->send_response($mod);
}

Expand Down

0 comments on commit c14cad3

Please sign in to comment.