| Línea 82... |
Línea 82... |
| 82 |
|
82 |
|
| 83 |
// Deal with enrolment methods and user enrolments.
|
83 |
// Deal with enrolment methods and user enrolments.
|
| 84 |
if ($this->plan->get_mode() == backup::MODE_IMPORT) {
|
84 |
if ($this->plan->get_mode() == backup::MODE_IMPORT) {
|
| Línea 85... |
Línea 85... |
| 85 |
// No need to do anything with enrolments.
|
85 |
// No need to do anything with enrolments.
|
| 86 |
|
86 |
|
| 87 |
} else if (!$this->get_setting_value('users') or $this->plan->get_mode() == backup::MODE_HUB) {
|
87 |
} else if (!$this->get_setting_value('users')) {
|
| 88 |
if ($this->get_setting_value('enrolments') == backup::ENROL_ALWAYS && $this->plan->get_mode() != backup::MODE_HUB) {
|
88 |
if ($this->get_setting_value('enrolments') == backup::ENROL_ALWAYS) {
|
| 89 |
// Restore enrolment methods.
|
89 |
// Restore enrolment methods.
|
| 90 |
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
|
90 |
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
|
| 91 |
} else if ($this->get_target() == backup::TARGET_CURRENT_ADDING or $this->get_target() == backup::TARGET_EXISTING_ADDING) {
|
91 |
} else if ($this->get_target() == backup::TARGET_CURRENT_ADDING or $this->get_target() == backup::TARGET_EXISTING_ADDING) {
|
| Línea 158... |
Línea 158... |
| 158 |
$rules = array();
|
158 |
$rules = array();
|
| Línea 159... |
Línea 159... |
| 159 |
|
159 |
|
| 160 |
// Link to the course main page (it also covers "&topic=xx" and "&week=xx"
|
160 |
// Link to the course main page (it also covers "&topic=xx" and "&week=xx"
|
| 161 |
// because they don't become transformed (section number) in backup/restore.
|
161 |
// because they don't become transformed (section number) in backup/restore.
|
| - |
|
162 |
$rules[] = new restore_decode_rule('COURSEVIEWBYID', '/course/view.php?id=$1', 'course');
|
| Línea 162... |
Línea 163... |
| 162 |
$rules[] = new restore_decode_rule('COURSEVIEWBYID', '/course/view.php?id=$1', 'course');
|
163 |
$rules[] = new restore_decode_rule('COURSESECTIONBYID', '/course/section.php?id=$1', 'course_section');
|
| 163 |
|
164 |
|
| 164 |
// A few other key course links.
|
165 |
// A few other key course links.
|
| 165 |
$rules[] = new restore_decode_rule('GRADEINDEXBYID', '/grade/index.php?id=$1', 'course');
|
166 |
$rules[] = new restore_decode_rule('GRADEINDEXBYID', '/grade/index.php?id=$1', 'course');
|
| 166 |
$rules[] = new restore_decode_rule('GRADEREPORTINDEXBYID', '/grade/report/index.php?id=$1', 'course');
|
167 |
$rules[] = new restore_decode_rule('GRADEREPORTINDEXBYID', '/grade/report/index.php?id=$1', 'course');
|
| 167 |
$rules[] = new restore_decode_rule('BADGESVIEWBYID', '/badges/view.php?type=2&id=$1', 'course');
|
168 |
$rules[] = new restore_decode_rule('BADGESVIEWBYID', '/badges/index.php?type=2&id=$1', 'course');
|
| 168 |
$rules[] = new restore_decode_rule('USERINDEXVIEWBYID', '/user/index.php?id=$1', 'course');
|
169 |
$rules[] = new restore_decode_rule('USERINDEXVIEWBYID', '/user/index.php?id=$1', 'course');
|
| Línea 169... |
Línea 170... |
| 169 |
$rules[] = new restore_decode_rule('PLUGINFILEBYCONTEXT', '/pluginfile.php/$1', 'context');
|
170 |
$rules[] = new restore_decode_rule('PLUGINFILEBYCONTEXT', '/pluginfile.php/$1', 'context');
|