Commit 0c74b33f authored by Marina Glancy's avatar Marina Glancy
Browse files

MDL-43333 blocks: move activity icon in social and main menu

parent fc630b2b
......@@ -72,6 +72,8 @@ class block_site_main_menu extends block_list {
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
$strcancel= get_string('cancel');
$stractivityclipboard = $USER->activitycopyname;
} else {
$strmove = get_string('move');
}
$editbuttons = '';
......@@ -90,18 +92,12 @@ class block_site_main_menu extends block_list {
if (!$ismoving) {
$actions = course_get_cm_edit_actions($mod, -1);
// Add the action move.
$modcontext = context_module::instance($mod->id);
$hasmanageactivities = has_capability('moodle/course:manageactivities', $modcontext);
if ($hasmanageactivities) {
$baseurl = new moodle_url('/course/mod.php', array('sesskey' => sesskey()));
$actions['move'] = new action_menu_link_primary(
new moodle_url($baseurl, array('copy' => $mod->id)),
new pix_icon('t/move', get_string('move'), 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('title' => get_string('move'))
);
}
// Prepend list of actions with the 'move' action.
$actions = array('move' => new action_menu_link_primary(
new moodle_url('/course/mod.php', array('sesskey' => sesskey(), 'copy' => $mod->id)),
new pix_icon('t/move', $strmove, 'moodle', array('class' => 'iconsmall', 'title' => '')),
$strmove
)) + $actions;
$editbuttons = html_writer::tag('div',
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
......
......@@ -74,6 +74,8 @@ class block_social_activities extends block_list {
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
$strcancel= get_string('cancel');
$stractivityclipboard = $USER->activitycopyname;
} else {
$strmove = get_string('move');
}
$editbuttons = '';
......@@ -91,6 +93,14 @@ class block_social_activities extends block_list {
}
if (!$ismoving) {
$actions = course_get_cm_edit_actions($mod, -1);
// Prepend list of actions with the 'move' action.
$actions = array('move' => new action_menu_link_primary(
new moodle_url('/course/mod.php', array('sesskey' => sesskey(), 'copy' => $mod->id)),
new pix_icon('t/move', $strmove, 'moodle', array('class' => 'iconsmall', 'title' => '')),
$strmove
)) + $actions;
$editbuttons = html_writer::tag('div',
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
array('class' => 'buttons')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment