Skip to content

Commit

Permalink
MDL-42969 Main Menu Block loses ability to move resource or activity …
Browse files Browse the repository at this point in the history
…up or down (add back exact same behavior than in 2.5)
  • Loading branch information
mouneyrac committed Nov 26, 2013
1 parent f7434db commit 2a974bb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions blocks/site_main_menu/block_site_main_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ function get_content() {
}
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')
Expand Down

0 comments on commit 2a974bb

Please sign in to comment.