MDL-39883 events: Create a new api create_from_cm for module create event

This commit is contained in:
Ankit Agarwal
2014-06-18 15:39:02 +08:00
parent 0a3d81c261
commit e20d306969
3 changed files with 35 additions and 20 deletions
+1 -10
View File
@@ -648,16 +648,7 @@ class dndupload_ajax_processor {
$mod = $info->get_cm($this->cm->id);
// Trigger course module created event.
$event = \core\event\course_module_created::create(array(
'courseid' => $this->course->id,
'context' => context_module::instance($mod->id),
'objectid' => $mod->id,
'other' => array(
'modulename' => $mod->modname,
'name' => $mod->name,
'instanceid' => $instanceid
)
));
$event = \core\event\course_module_created::create_from_cm($mod);
$event->trigger();
$this->send_response($mod);