mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-31595 improve enrol link comments
This commit is contained in:
parent
6813cdf73a
commit
39ec18db5b
@ -476,10 +476,10 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
|
||||
$usersnode->trim_if_empty();
|
||||
|
||||
if ($course->id != SITEID) {
|
||||
// Unenrol link
|
||||
if (isguestuser() or !isloggedin()) {
|
||||
// guest account can not be enrolled
|
||||
// guest account can not be enrolled - no links for them
|
||||
} else if (is_enrolled($coursecontext)) {
|
||||
// unenrol link if possible
|
||||
foreach ($instances as $instance) {
|
||||
if (!isset($plugins[$instance->enrol])) {
|
||||
continue;
|
||||
@ -493,6 +493,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// enrol link if possible
|
||||
if (is_viewing($coursecontext)) {
|
||||
// better not show any enrol link, this is intended for managers and inspectors
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user