mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 01:44:27 +02:00
MDL-43333 blocks: move activity icon in social and main menu
This commit is contained in:
parent
fc630b2b01
commit
0c74b33fbf
blocks
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user