mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-43333 blocks: move activity icon in social and main menu
This commit is contained in:
parent
fc630b2b01
commit
0c74b33fbf
2 changed files with 18 additions and 12 deletions
|
@ -72,6 +72,8 @@ class block_site_main_menu extends block_list {
|
||||||
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
|
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
|
||||||
$strcancel= get_string('cancel');
|
$strcancel= get_string('cancel');
|
||||||
$stractivityclipboard = $USER->activitycopyname;
|
$stractivityclipboard = $USER->activitycopyname;
|
||||||
|
} else {
|
||||||
|
$strmove = get_string('move');
|
||||||
}
|
}
|
||||||
$editbuttons = '';
|
$editbuttons = '';
|
||||||
|
|
||||||
|
@ -90,18 +92,12 @@ class block_site_main_menu extends block_list {
|
||||||
if (!$ismoving) {
|
if (!$ismoving) {
|
||||||
$actions = course_get_cm_edit_actions($mod, -1);
|
$actions = course_get_cm_edit_actions($mod, -1);
|
||||||
|
|
||||||
// Add the action move.
|
// Prepend list of actions with the 'move' action.
|
||||||
$modcontext = context_module::instance($mod->id);
|
$actions = array('move' => new action_menu_link_primary(
|
||||||
$hasmanageactivities = has_capability('moodle/course:manageactivities', $modcontext);
|
new moodle_url('/course/mod.php', array('sesskey' => sesskey(), 'copy' => $mod->id)),
|
||||||
if ($hasmanageactivities) {
|
new pix_icon('t/move', $strmove, 'moodle', array('class' => 'iconsmall', 'title' => '')),
|
||||||
$baseurl = new moodle_url('/course/mod.php', array('sesskey' => sesskey()));
|
$strmove
|
||||||
$actions['move'] = new action_menu_link_primary(
|
)) + $actions;
|
||||||
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'))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$editbuttons = html_writer::tag('div',
|
$editbuttons = html_writer::tag('div',
|
||||||
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
|
$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'"));
|
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
|
||||||
$strcancel= get_string('cancel');
|
$strcancel= get_string('cancel');
|
||||||
$stractivityclipboard = $USER->activitycopyname;
|
$stractivityclipboard = $USER->activitycopyname;
|
||||||
|
} else {
|
||||||
|
$strmove = get_string('move');
|
||||||
}
|
}
|
||||||
$editbuttons = '';
|
$editbuttons = '';
|
||||||
|
|
||||||
|
@ -91,6 +93,14 @@ class block_social_activities extends block_list {
|
||||||
}
|
}
|
||||||
if (!$ismoving) {
|
if (!$ismoving) {
|
||||||
$actions = course_get_cm_edit_actions($mod, -1);
|
$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',
|
$editbuttons = html_writer::tag('div',
|
||||||
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
|
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
|
||||||
array('class' => 'buttons')
|
array('class' => 'buttons')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue