MDL-78457 course: remove participants navigation if cannot access.

This commit is contained in:
Paul Holden
2024-04-02 10:03:53 +01:00
parent 23b110b28b
commit 1cce6e50c9
+3
View File
@@ -2955,6 +2955,9 @@ class global_navigation extends navigation_node {
}
} else if (count($this->extendforuser) > 0) {
$coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants');
} else if ($siteparticipantsnode = $this->rootnodes['site']->get('participants', self::TYPE_CUSTOM)) {
// The participants node was added for the site, but cannot be viewed inside the course itself, so remove.
$siteparticipantsnode->remove();
}
// Badges.