Skip to content

Commit

Permalink
Merge branch 'MDL-29563_22' of https://github.com/dmonllao/moodle int…
Browse files Browse the repository at this point in the history
…o MOODLE_22_STABLE
  • Loading branch information
Sam Hemelryk committed Jul 22, 2012
2 parents 465775f + e352a32 commit 71268dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions course/lib.php
Expand Up @@ -3213,8 +3213,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) // Duplicate (require both target import caps to be able to duplicate and backup2 support, see modduplicate.php)
if (has_all_capabilities($dupecaps, $coursecontext)) { if (has_all_capabilities($dupecaps, $coursecontext) && plugin_supports('mod', $mod->modname, FEATURE_BACKUP_MOODLE2)) {
$actions[] = new action_link( $actions[] = new action_link(
new moodle_url($baseurl, array('duplicate' => $mod->id)), new moodle_url($baseurl, array('duplicate' => $mod->id)),
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')), new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')),
Expand Down
13 changes: 9 additions & 4 deletions course/modduplicate.php
Expand Up @@ -55,6 +55,15 @@


$output = $PAGE->get_renderer('core', 'backup'); $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', 'core', $url, $a);
}

// backup the activity // backup the activity


$bc = new backup_controller(backup::TYPE_1ACTIVITY, $cm->id, backup::FORMAT_MOODLE, $bc = new backup_controller(backup::TYPE_1ACTIVITY, $cm->id, backup::FORMAT_MOODLE,
Expand Down Expand Up @@ -117,10 +126,6 @@
fulldelete($backupbasepath); fulldelete($backupbasepath);
} }


$a = new stdClass();
$a->modtype = get_string('modulename', $cm->modname);
$a->modname = format_string($cm->name);

echo $output->header(); echo $output->header();


if ($newcmid) { if ($newcmid) {
Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Expand Up @@ -465,6 +465,7 @@
$string['duplicateconfirm'] = 'Are you sure you want to duplicate {$a->modtype} \'{$a->modname}\' ?'; $string['duplicateconfirm'] = 'Are you sure you want to duplicate {$a->modtype} \'{$a->modname}\' ?';
$string['duplicatecontcourse'] = 'Return to the course'; $string['duplicatecontcourse'] = 'Return to the course';
$string['duplicatecontedit'] = 'Edit the new copy'; $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['duplicatesuccess'] = '{$a->modtype} \'{$a->modname}\' has been duplicated successfully';
$string['duplicatinga'] = 'Duplicating: {$a}'; $string['duplicatinga'] = 'Duplicating: {$a}';
$string['edhelpaspellpath'] = 'To use spell-checking within the editor, you MUST have <strong>aspell 0.50</strong> 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 <strong>/usr/bin/aspell</strong>, but it might be something else.'; $string['edhelpaspellpath'] = 'To use spell-checking within the editor, you MUST have <strong>aspell 0.50</strong> 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 <strong>/usr/bin/aspell</strong>, but it might be something else.';
Expand Down

0 comments on commit 71268dd

Please sign in to comment.