Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'wip-MDL-21097-m25' of git://github.com/marinaglancy/moo…

…dle into MOODLE_25_STABLE
  • Loading branch information...
commit e0e6015416487391c8ac3c4d4e8aaff6662ec3ce 2 parents 179fbc7 + 6b52abc
Dan Poltawski authored June 05, 2013

Showing 1 changed file with 11 additions and 13 deletions. Show diff stats Hide diff stats

  1. 24  course/view.php
24  course/view.php
@@ -122,6 +122,7 @@
122 122
 
123 123
     $PAGE->set_pagelayout('course');
124 124
     $PAGE->set_pagetype('course-view-' . $course->format);
  125
+    $PAGE->set_other_editing_capability('moodle/course:update');
125 126
     $PAGE->set_other_editing_capability('moodle/course:manageactivities');
126 127
     $PAGE->set_other_editing_capability('moodle/course:activityvisibility');
127 128
     if (course_format_uses_sections($course->format)) {
@@ -194,20 +195,17 @@
194 195
             }
195 196
         }
196 197
 
197  
-        if (has_capability('moodle/course:update', $context)) {
198  
-            if (!empty($section)) {
199  
-                if (!empty($move) and has_capability('moodle/course:movesections', $context) and confirm_sesskey()) {
200  
-                    $destsection = $section + $move;
201  
-                    if (move_section_to($course, $section, $destsection)) {
202  
-                        if ($course->id == SITEID) {
203  
-                            redirect($CFG->wwwroot . '/?redirect=0');
204  
-                        } else {
205  
-                            redirect(course_get_url($course));
206  
-                        }
207  
-                    } else {
208  
-                        echo $OUTPUT->notification('An error occurred while moving a section');
209  
-                    }
  198
+        if (!empty($section) && !empty($move) &&
  199
+                has_capability('moodle/course:movesections', $context) && confirm_sesskey()) {
  200
+            $destsection = $section + $move;
  201
+            if (move_section_to($course, $section, $destsection)) {
  202
+                if ($course->id == SITEID) {
  203
+                    redirect($CFG->wwwroot . '/?redirect=0');
  204
+                } else {
  205
+                    redirect(course_get_url($course));
210 206
                 }
  207
+            } else {
  208
+                echo $OUTPUT->notification('An error occurred while moving a section');
211 209
             }
212 210
         }
213 211
     } else {

0 notes on commit e0e6015

Please sign in to comment.
Something went wrong with that request. Please try again.