Merge branch 'MDL-36986' of git://github.com/moodlerooms/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 5 Feb 2013 02:47:15 +0000 (10:47 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 5 Feb 2013 02:47:15 +0000 (10:47 +0800)
backup/util/plan/restore_plan.class.php
lib/db/events.php

index 3d0c6ca..9943e0b 100644 (file)
@@ -156,6 +156,16 @@ class restore_plan extends base_plan implements loggable {
         $this->controller->set_status(backup::STATUS_EXECUTING);
         parent::execute();
         $this->controller->set_status(backup::STATUS_FINISHED_OK);
+
+        events_trigger('course_restored', (object) array(
+            'courseid'  => $this->get_courseid(), // The new course
+            'userid'    => $this->get_userid(), // User doing the restore
+            'type'      => $this->controller->get_type(), // backup::TYPE_* constant
+            'target'    => $this->controller->get_target(), // backup::TARGET_* constant
+            'mode'      => $this->controller->get_mode(), // backup::MODE_* constant
+            'operation' => $this->controller->get_operation(), // backup::OPERATION_* constant
+            'samesite'  => $this->controller->is_samesite(),
+        ));
     }
 
     /**
index 769ad0b..07641db 100644 (file)
@@ -77,6 +77,7 @@ course_created - object course table record
 course_updated - object course table record
 course_content_removed - object course table record + context property
 course_deleted - object course table record + context property
+course_restored - custom object with courseid, userid and restore information
 
 user_enrolled - object record from user_enrolments table + courseid,enrol
 user_enrol_modified - object record from user_enrolments table + courseid,enrol