mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Added has_capability call
This commit is contained in:
parent
67e4cf27e2
commit
6006c31d28
@ -27,8 +27,8 @@ class block_site_main_menu extends block_list {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$course = get_record('course', 'id', $this->instance->pageid);
|
$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);
|
$isediting = isediting($this->instance->pageid);
|
||||||
$ismoving = ismoving($this->instance->pageid);
|
$ismoving = ismoving($this->instance->pageid);
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ class block_site_main_menu extends block_list {
|
|||||||
} else {
|
} else {
|
||||||
$editbuttons = '';
|
$editbuttons = '';
|
||||||
}
|
}
|
||||||
if ($mod->visible || $isteacher) {
|
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $context)) {
|
||||||
if ($ismoving) {
|
if ($ismoving) {
|
||||||
if ($mod->id == $USER->activitycopy) {
|
if ($mod->id == $USER->activitycopy) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user