diff -Naurw course_menu/block_course_menu.php course_menu_new/block_course_menu.php --- course_menu/block_course_menu.php 2012-07-30 15:26:04.681428152 +0100 +++ course_menu_new/block_course_menu.php 2012-08-01 15:28:22.988316520 +0100 @@ -763,7 +763,11 @@ } } + //hide hidden sections from students if the course settings say that - bug #212 + // $coursecontext = get_context_instance(CONTEXT_COURSE, $this->course->id); + // if (!($section->visible == 0 && !has_capability('moodle/course:viewhiddensections', $coursecontext))) { $sections[] = $newSec; + // } } } } diff -Naurw course_menu/renderer.php course_menu_new/renderer.php --- course_menu/renderer.php 2012-07-30 11:56:49.265365261 +0100 +++ course_menu_new/renderer.php 2012-08-01 15:23:41.707316186 +0100 @@ -97,6 +97,9 @@ public function render_topic($config, $section, $depth = 0, $current = false) { + global $PAGE; + $coursecontext = get_context_instance(CONTEXT_COURSE, $PAGE->course->id); + if (!($section['visible'] == 0 && !has_capability('moodle/course:viewhiddensections', $coursecontext))) { if ($depth == 0) { $depth = $this->topic_depth; } @@ -138,7 +141,7 @@ $html = $this->render_leaf($section['trimmed_name'], $leafIcon, $attributes, $section['url'], $current); } - + } return $html; }