Skip to content
Permalink
Browse files

MDL-31443 backup: Title and cancel messages stating import and restore

  • Loading branch information...
lucaboesch committed Jan 15, 2018
1 parent 50e48a8 commit f55b45e473210727e1ddd83e2714e58e99f76c67
@@ -183,7 +183,11 @@ protected function initialise_stage_form() {
foreach ($tasks as &$task) {
// For the initial stage we are only interested in the root settings.
if ($task instanceof backup_root_task) {
$form->add_heading('rootsettings', get_string('rootsettings', 'backup'));
if ($this->ui instanceof import_ui) {
$form->add_heading('rootsettings', get_string('importrootsettings', 'backup'));
} else {
$form->add_heading('rootsettings', get_string('rootsettings', 'backup'));
}
$settings = $task->get_settings();
// First add all settings except the filename setting.
foreach ($settings as &$setting) {
@@ -469,7 +473,11 @@ protected function initialise_stage_form() {
foreach ($tasks as $task) {
if ($task instanceof backup_root_task) {
// If its a backup root add a root settings heading to group nicely.
$form->add_heading('rootsettings', get_string('rootsettings', 'backup'));
if ($this->ui instanceof import_ui) {
$form->add_heading('rootsettings', get_string('importrootsettings', 'backup'));
} else {
$form->add_heading('rootsettings', get_string('rootsettings', 'backup'));
}
} else if (!$courseheading) {
// We haven't already add a course heading.
$form->add_heading('coursesettings', get_string('includeditems', 'backup'));
@@ -383,7 +383,13 @@ public function display() {
$this->require_definition_after_data();
$config = new stdClass;
$config->title = get_string('confirmcancel', 'backup');
if ($this->uistage->get_ui() instanceof import_ui) {
$config->title = get_string('confirmcancelimport', 'backup');
} else if ($this->uistage->get_ui() instanceof restore_ui) {
$config->title = get_string('confirmcancelrestore', 'backup');
} else {
$config->title = get_string('confirmcancel', 'backup');
}
$config->question = get_string('confirmcancelquestion', 'backup');
$config->yesLabel = get_string('confirmcancelyes', 'backup');
$config->noLabel = get_string('confirmcancelno', 'backup');
@@ -125,7 +125,13 @@ public function backup_details($details, $nextstageurl) {
$html .= html_writer::end_tag('div');
$html .= html_writer::start_tag('div', array('class' => 'backup-section settings-section'));
$html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class' => 'header'));
if ($this instanceof import_ui_stage_inital) {
$html .= $this->output->heading(get_string('importrootsettings', 'backup'), 2, array('class' => 'header'));
} else if ($this instanceof restore_ui_stage_settings) {
$html .= $this->output->heading(get_string('restorerootsettings', 'backup'), 2, array('class' => 'header'));
} else {
$html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class' => 'header'));
}
foreach ($details->root_settings as $label => $value) {
if ($label == 'filename' or $label == 'user_files') {
continue;
@@ -120,6 +120,8 @@
$string['configrestoreuserscompletion'] = 'If enabled user completion information will be restored by default if it was included in the backup.';
$string['configrestoreusers'] = 'Sets the default for whether to restore users if they were included in the backup.';
$string['confirmcancel'] = 'Cancel backup';
$string['confirmcancelrestore'] = 'Cancel restore';
$string['confirmcancelimport'] = 'Cancel import';
$string['confirmcancelquestion'] = 'Are you sure you wish to cancel?
Any information you have entered will be lost.';
$string['confirmcancelyes'] = 'Cancel';
@@ -198,6 +200,7 @@
$string['importcurrentstage4'] = 'Confirmation and review';
$string['importcurrentstage8'] = 'Perform import';
$string['importcurrentstage16'] = 'Complete';
$string['importrootsettings'] = 'Import settings';
$string['importsettings'] = 'General import settings';
$string['importsuccess'] = 'Import complete. Click continue to return to the course.';
$string['includeactivities'] = 'Include:';

0 comments on commit f55b45e

Please sign in to comment.
You can’t perform that action at this time.