MDL-31595 improve enrol link comments

This commit is contained in:
Petr Skoda 2012-03-12 16:47:28 +01:00
parent 6813cdf73a
commit 39ec18db5b

View File

@ -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 {