Skip to content

Commit

Permalink
Merge branch 'MDL-77168-master' of https://github.com/andrewnicols/mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed May 31, 2023
2 parents 9bc2c51 + 6a417a3 commit accddab
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 310 deletions.
49 changes: 30 additions & 19 deletions backup/util/ui/base_moodleform.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,36 @@ public function definition_after_data() {
$buttonarray[] = $this->_form->createElement('submit', 'oneclickbackup', get_string('jumptofinalstep', 'backup'),
array('class' => 'oneclickbackup'));
}
$buttonarray[] = $this->_form->createElement('cancel', 'cancel', get_string('cancel'), array('class' => 'confirmcancel'));

$cancelparams = [
'data-modal' => 'confirmation',
'data-modal-content-str' => json_encode([
'confirmcancelquestion',
'backup',
]),
'data-modal-yes-button-str' => json_encode([
'yes',
'moodle',
]),
];
if ($this->uistage->get_ui() instanceof import_ui) {
$cancelparams['data-modal-title-str'] = json_encode([
'confirmcancelimport',
'backup',
]);
} else if ($this->uistage->get_ui() instanceof restore_ui) {
$cancelparams['data-modal-title-str'] = json_encode([
'confirmcancelrestore',
'backup',
]);
} else {
$cancelparams['data-modal-title-str'] = json_encode([
'confirmcancel',
'backup',
]);
}

$buttonarray[] = $this->_form->createElement('cancel', 'cancel', get_string('cancel'), $cancelparams);
$buttonarray[] = $this->_form->createElement(
'submit',
'submitbutton',
Expand Down Expand Up @@ -383,24 +412,6 @@ public function display() {

$this->require_definition_after_data();

$config = new stdClass;
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 = $config->title;
$config->noLabel = get_string('confirmcancelno', 'backup');
$config->closeButtonTitle = get_string('close', 'editor');
$PAGE->requires->yui_module(
'moodle-backup-confirmcancel',
'M.core_backup.confirmcancel.watch_cancel_buttons',
array($config)
);

// Get list of module types on course.
$modinfo = get_fast_modinfo($COURSE);
$modnames = array_map('strval', $modinfo->get_used_module_names(true));
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions backup/util/ui/yui/src/confirmcancel/build.json

This file was deleted.

86 changes: 0 additions & 86 deletions backup/util/ui/yui/src/confirmcancel/js/confirmcancel.js

This file was deleted.

9 changes: 0 additions & 9 deletions backup/util/ui/yui/src/confirmcancel/meta/confirmcancel.json

This file was deleted.

2 changes: 1 addition & 1 deletion lib/amd/build/utility.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit accddab

Please sign in to comment.