Skip to content
Browse files

MDL-31595 improve enrol link comments

  • Loading branch information...
1 parent 112ecf6 commit 96b421fd91a070ef83467915971f9cae1e6e32b3 @skodak skodak committed Mar 12, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/enrollib.php
View
5 lib/enrollib.php
@@ -469,10 +469,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;
@@ -486,6 +486,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 {

0 comments on commit 96b421f

Please sign in to comment.
Something went wrong with that request. Please try again.