Skip to content

Commit

Permalink
Merge branch 'MDL-35494_m27' of https://github.com/markn86/moodle int…
Browse files Browse the repository at this point in the history
…o MOODLE_27_STABLE
  • Loading branch information
Sam Hemelryk committed Nov 23, 2014
2 parents 06378d1 + 598fa03 commit f9ed19e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backup/util/ui/renderer.php
Expand Up @@ -301,6 +301,11 @@ public function course_selector(moodle_url $nextstageurl, $wholecourse = true, r
$html .= html_writer::end_tag('form');
}

// If we are restoring an activity, then include the current course.
if (!$wholecourse) {
$courses->invalidate_results(); // Clean list of courses.
$courses->set_include_currentcourse();
}
if (!empty($courses) && ($courses->get_count() > 0 || $courses->get_search())) {
// Existing course
$hasrestoreoption = true;
Expand All @@ -311,10 +316,7 @@ public function course_selector(moodle_url $nextstageurl, $wholecourse = true, r
$html .= $this->backup_detail_input(get_string('restoretoexistingcourseadding', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_ADDING, array('checked'=>'checked'));
$html .= $this->backup_detail_input(get_string('restoretoexistingcoursedeleting', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_DELETING);
} else {
// We only allow restore adding to existing for now. Enforce it here.
$html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'target', 'value'=>backup::TARGET_EXISTING_ADDING));
$courses->invalidate_results(); // Clean list of courses
$courses->set_include_currentcourse(); // Show current course in the list
}
$selectacoursehtml = $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
// Display the course selection as required if the form was submitted but this data was not supplied.
Expand Down

0 comments on commit f9ed19e

Please sign in to comment.