Permalink
Browse files

MDL-42969 Main Menu Block loses ability to move resource or activity …

…up or down (add back exact same behavior than in 2.5)
  • Loading branch information...
1 parent fe0d1d4 commit 7d2f938cf021dfa4b8358bb6828ccc5c09f37c8d @mouneyrac mouneyrac committed with danpoltawski Nov 26, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 blocks/site_main_menu/block_site_main_menu.php
@@ -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')

0 comments on commit 7d2f938

Please sign in to comment.