Merge branch 'MOODLE_master_MDL-74773' of https://github.com/danielneis/moodle

This commit is contained in:
Ilya Tregubov 2023-08-03 09:18:42 +08:00
commit 7144dccdd8
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1
2 changed files with 8 additions and 1 deletions

View File

@ -123,10 +123,15 @@ if ($editorform->is_cancelled()) {
}
redirect($returnurl);
} else if ($data = $editorform->get_data()) {
if (empty($id)) {
$msg = get_string('contentcreated', 'contentbank');
} else {
$msg = get_string('contentupdated', 'contentbank');
}
$id = $editorform->save_content($data);
// Just in case we've created a new content.
$returnurl->param('id', $id);
redirect($returnurl);
redirect($returnurl, $msg, null, \core\output\notification::NOTIFY_SUCCESS);
}
echo $OUTPUT->header();

View File

@ -37,6 +37,8 @@ $string['contenttypenoaccess'] = 'You cannot view this {$a} instance.';
$string['contenttypenoedit'] = 'You can not edit this content';
$string['contentvisibilitychanged'] = 'The content has been made {$a}.';
$string['contentvisibilitynotset'] = 'An error was encountered while trying to set the content visibility.';
$string['contentcreated'] = 'Content created.';
$string['contentupdated'] = 'Content updated.';
$string['contextnotallowed'] = 'You are not allowed to access the content bank in this context.';
$string['copycontent'] = 'Copy content';
$string['copyof'] = 'Copy of {$a}';