MDL-42969 Main Menu Block loses ability to move resource or activity up or down (add back exact same behavior than in 2.5)
This commit is contained in:
committed by
Dan Poltawski
parent
fe0d1d488b
commit
7d2f938cf0
@@ -89,6 +89,20 @@ 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'))
|
||||
);
|
||||
}
|
||||
|
||||
$editbuttons = html_writer::tag('div',
|
||||
$courserenderer->course_section_cm_edit_actions($actions, $mod, array('donotenhance' => true)),
|
||||
array('class' => 'buttons')
|
||||
|
||||
Reference in New Issue
Block a user