Merge branch 'w11_MDL-31595_m23_enrolme' of git://github.com/skodak/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2012-03-12 18:00:23 +01:00
+5 -2
View File
@@ -476,8 +476,10 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
$usersnode->trim_if_empty();
if ($course->id != SITEID) {
// Unenrol link
if (is_enrolled($coursecontext)) {
if (isguestuser() or !isloggedin()) {
// 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;
@@ -491,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 {