From 6006c31d28a5913a975028bda64878e84dc1c0aa Mon Sep 17 00:00:00 2001 From: vyshane Date: Tue, 15 Aug 2006 06:37:55 +0000 Subject: [PATCH] Added has_capability call --- blocks/site_main_menu/block_site_main_menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 9c945193d76..5ff6bb073bd 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -27,8 +27,8 @@ class block_site_main_menu extends block_list { } $course = get_record('course', 'id', $this->instance->pageid); + $context = get_context_instance(CONTEXT_COURSE, $course->id); - $isteacher = isteacher($this->instance->pageid); $isediting = isediting($this->instance->pageid); $ismoving = ismoving($this->instance->pageid); @@ -80,7 +80,7 @@ class block_site_main_menu extends block_list { } else { $editbuttons = ''; } - if ($mod->visible || $isteacher) { + if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $context)) { if ($ismoving) { if ($mod->id == $USER->activitycopy) { continue;