Skip to content

Commit

Permalink
Merge branch 'wip-MDL-21097-m25' of git://github.com/marinaglancy/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_25_STABLE
  • Loading branch information
danpoltawski committed Jun 5, 2013
2 parents 179fbc7 + 6b52abc commit e0e6015
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions course/view.php
Expand Up @@ -122,6 +122,7 @@

$PAGE->set_pagelayout('course');
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_other_editing_capability('moodle/course:activityvisibility');
if (course_format_uses_sections($course->format)) {
Expand Down Expand Up @@ -194,20 +195,17 @@
}
}

if (has_capability('moodle/course:update', $context)) {
if (!empty($section)) {
if (!empty($move) and has_capability('moodle/course:movesections', $context) and confirm_sesskey()) {
$destsection = $section + $move;
if (move_section_to($course, $section, $destsection)) {
if ($course->id == SITEID) {
redirect($CFG->wwwroot . '/?redirect=0');
} else {
redirect(course_get_url($course));
}
} else {
echo $OUTPUT->notification('An error occurred while moving a section');
}
if (!empty($section) && !empty($move) &&
has_capability('moodle/course:movesections', $context) && confirm_sesskey()) {
$destsection = $section + $move;
if (move_section_to($course, $section, $destsection)) {
if ($course->id == SITEID) {
redirect($CFG->wwwroot . '/?redirect=0');
} else {
redirect(course_get_url($course));
}
} else {
echo $OUTPUT->notification('An error occurred while moving a section');
}
}
} else {
Expand Down

0 comments on commit e0e6015

Please sign in to comment.