From 39ec18db5bea1a657b5bb2519cbdea7525bf1c71 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 12 Mar 2012 16:47:28 +0100 Subject: [PATCH] MDL-31595 improve enrol link comments --- lib/enrollib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/enrollib.php b/lib/enrollib.php index 4072905eab1..7fd29e68f08 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -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 {