~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to backup/util/plan/restore_plan.class.php

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        return $this->controller->get_logger();
95
95
    }
96
96
 
 
97
    /**
 
98
     * Gets the progress reporter, which can be used to report progress within
 
99
     * the backup or restore process.
 
100
     *
 
101
     * @return core_backup_progress Progress reporting object
 
102
     */
 
103
    public function get_progress() {
 
104
        return $this->controller->get_progress();
 
105
    }
 
106
 
97
107
    public function get_info() {
98
108
        return $this->controller->get_info();
99
109
    }
157
167
        parent::execute();
158
168
        $this->controller->set_status(backup::STATUS_FINISHED_OK);
159
169
 
160
 
        events_trigger('course_restored', (object) array(
161
 
            'courseid'  => $this->get_courseid(), // The new course
162
 
            'userid'    => $this->get_userid(), // User doing the restore
163
 
            'type'      => $this->controller->get_type(), // backup::TYPE_* constant
164
 
            'target'    => $this->controller->get_target(), // backup::TARGET_* constant
165
 
            'mode'      => $this->controller->get_mode(), // backup::MODE_* constant
166
 
            'operation' => $this->controller->get_operation(), // backup::OPERATION_* constant
167
 
            'samesite'  => $this->controller->is_samesite(),
 
170
        // Trigger a course restored event.
 
171
        $event = \core\event\course_restored::create(array(
 
172
            'objectid' => $this->get_courseid(),
 
173
            'userid' => $this->get_userid(),
 
174
            'context' => context_course::instance($this->get_courseid()),
 
175
            'other' => array('type' => $this->controller->get_type(),
 
176
                             'target' => $this->controller->get_target(),
 
177
                             'mode' => $this->controller->get_mode(),
 
178
                             'operation' => $this->controller->get_operation(),
 
179
                             'samesite' => $this->controller->is_samesite())
168
180
        ));
 
181
        $event->trigger();
169
182
    }
170
183
 
171
184
    /**