diff --git a/course/modduplicate.php b/course/modduplicate.php index b4d593b4e01..e8c5c1b3a43 100644 --- a/course/modduplicate.php +++ b/course/modduplicate.php @@ -61,13 +61,8 @@ $a->modtype = get_string('modulename', $cm->modname); $a->modname = format_string($cm->name); if (!plugin_supports('mod', $cm->modname, FEATURE_BACKUP_MOODLE2)) { - echo $output->header(); - echo $output->notification(get_string('duplicatenosupport', 'core', $a)); - echo $output->continue_button( - new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id)) - ); - echo $output->footer(); - die; + $url = new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id)); + print_error('duplicatenosupport', 'error', $url, $a); } // backup the activity diff --git a/lang/en/error.php b/lang/en/error.php index 7ad032cec31..b9e57071480 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -204,6 +204,7 @@ $string['dmlwriteexception'] = 'Error writing to database'; $string['downgradedcore'] = 'ERROR!!! The code you are using is OLDER than the version that made these databases!'; $string['downloadedfilecheckfailed'] = 'Downloaded file check failed'; $string['duplicatefieldname'] = 'Duplicate field name "{$a}" detected'; +$string['duplicatenosupport'] = '\'{$a->modname}\' activity could not be duplicated because the {$a->modtype} module does not support backup and restore.'; $string['duplicateparaminsql'] = 'ERROR: duplicate parameter name in query'; $string['duplicaterolename'] = 'There is already a role with this name!'; $string['duplicateroleshortname'] = 'There is already a role with this short name!'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 1aae903d93e..af23c90f27a 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -487,7 +487,6 @@ $string['duplicate'] = 'Duplicate'; $string['duplicateconfirm'] = 'Are you sure you want to duplicate {$a->modtype} \'{$a->modname}\' ?'; $string['duplicatecontcourse'] = 'Return to the course'; $string['duplicatecontedit'] = 'Edit the new copy'; -$string['duplicatenosupport'] = '\'{$a->modname}\' activity could not be duplicated because the {$a->modtype} module does not support backup and restore.'; $string['duplicatesuccess'] = '{$a->modtype} \'{$a->modname}\' has been duplicated successfully'; $string['duplicatinga'] = 'Duplicating: {$a}'; $string['edhelpaspellpath'] = 'To use spell-checking within the editor, you MUST have aspell 0.50 or later installed on your server, and you must specify the correct path to access the aspell binary. On Unix/Linux systems, this path is usually /usr/bin/aspell, but it might be something else.';