. /** * @package mod * @subpackage autoattendmod * @copyright 2016 Fumi.Iseki */ /** * Define all the restore steps that will be used by the restore_url_activity_task */ /** * Structure step to restore one autoattendmod activity */ class restore_autoattendmod_activity_structure_step extends restore_activity_structure_step { protected function define_structure() { $paths = array(); $paths[] = new restore_path_element('autoattendmod', '/activity/autoattendmod'); // Return the paths wrapped into standard activity structure return $this->prepare_activity_structure($paths); } // protected function process_autoattendmod($data) { global $DB; $data = (object)$data; $oldid = $data->id; $data->course = $this->get_courseid(); //$data->timemodified = $this->apply_date_offset($data->timemodified); $newitemid = $DB->insert_record('autoattendmod', $data); $this->apply_activity_instance($newitemid); } // protected function after_execute() { // Add autoattendmod related files, no need to match by itemname (just internally handled context) $this->add_related_files('mod_autoattendmod', 'intro', null); } }