Merge branch 'MDL-53537_m34v4' of https://github.com/sbourget/moodle

This commit is contained in:
Andrew Nicols 2017-08-16 08:46:55 +08:00
commit 34cf57f1d0
5 changed files with 182 additions and 0 deletions

View file

@ -119,6 +119,21 @@ class backup_plan extends base_plan implements loggable {
$this->controller->set_status(backup::STATUS_EXECUTING);
parent::execute();
$this->controller->set_status(backup::STATUS_FINISHED_OK);
if ($this->controller->get_type() === backup::TYPE_1COURSE) {
// Trigger a course_backup_created event.
$otherarray = array('format' => $this->controller->get_format(),
'mode' => $this->controller->get_mode(),
'interactive' => $this->controller->get_interactive(),
'type' => $this->controller->get_type(),
);
$event = \core\event\course_backup_created::create(array(
'objectid' => $this->get_courseid(),
'context' => context_course::instance($this->get_courseid()),
'other' => $otherarray
));
$event->trigger();
}
}
}