Merge branch 'MDL-29563_master' of https://github.com/dmonllao/moodle
This commit is contained in:
+2
-2
@@ -3291,8 +3291,8 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
|
||||
);
|
||||
}
|
||||
|
||||
// Duplicate (require both target import caps to be able to duplicate, see modduplicate.php)
|
||||
if (has_all_capabilities($dupecaps, $coursecontext)) {
|
||||
// Duplicate (require both target import caps to be able to duplicate and backup2 support, see modduplicate.php)
|
||||
if (has_all_capabilities($dupecaps, $coursecontext) && plugin_supports('mod', $mod->modname, FEATURE_BACKUP_MOODLE2)) {
|
||||
$actions[] = new action_link(
|
||||
new moodle_url($baseurl, array('duplicate' => $mod->id)),
|
||||
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')),
|
||||
|
||||
@@ -56,6 +56,15 @@ $PAGE->set_pagelayout('incourse');
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'backup');
|
||||
|
||||
$a = new stdClass();
|
||||
$a->modtype = get_string('modulename', $cm->modname);
|
||||
$a->modname = format_string($cm->name);
|
||||
|
||||
if (!plugin_supports('mod', $cm->modname, FEATURE_BACKUP_MOODLE2)) {
|
||||
$url = new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id));
|
||||
print_error('duplicatenosupport', 'error', $url, $a);
|
||||
}
|
||||
|
||||
// backup the activity
|
||||
|
||||
$bc = new backup_controller(backup::TYPE_1ACTIVITY, $cm->id, backup::FORMAT_MOODLE,
|
||||
@@ -118,10 +127,6 @@ if (empty($CFG->keeptempdirectoriesonbackup)) {
|
||||
fulldelete($backupbasepath);
|
||||
}
|
||||
|
||||
$a = new stdClass();
|
||||
$a->modtype = get_string('modulename', $cm->modname);
|
||||
$a->modname = format_string($cm->name);
|
||||
|
||||
echo $output->header();
|
||||
|
||||
if ($newcmid) {
|
||||
|
||||
@@ -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!';
|
||||
|
||||
Reference in New Issue
Block a user