mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-44190 backup: Current course will be selected by default
This commit is contained in:
parent
e77452220b
commit
18dca30eca
@ -754,9 +754,12 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$row->attributes['class'] .= ' dimmed';
|
||||
}
|
||||
$id = $this->make_unique_id('restore-course');
|
||||
$attrs = ['type' => 'radio', 'name' => 'targetid', 'value' => $course->id, 'id' => $id];
|
||||
if ($course->id == $component->get_current_course_id()) {
|
||||
$attrs['checked'] = 'checked';
|
||||
}
|
||||
$row->cells = [
|
||||
html_writer::empty_tag('input', ['type' => 'radio', 'name' => 'targetid', 'value' => $course->id,
|
||||
'id' => $id]),
|
||||
html_writer::empty_tag('input', $attrs),
|
||||
html_writer::label(
|
||||
format_string($course->shortname, true, ['context' => context_course::instance($course->id)]),
|
||||
$id,
|
||||
|
@ -363,6 +363,15 @@ class restore_course_search extends restore_search_base {
|
||||
public function set_include_currentcourse() {
|
||||
$this->includecurrentcourse = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current course id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_current_course_id(): int {
|
||||
return $this->currentcourseid;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user