Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31595 improve enrol link comments

  • Loading branch information...
commit 1b75985a391d9acee2aa2554923ed1daf0a14c22 1 parent 45962a1
Petr Skoda skodak authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 lib/enrollib.php
5 lib/enrollib.php
@@ -476,10 +476,10 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
476 476 $usersnode->trim_if_empty();
477 477
478 478 if ($course->id != SITEID) {
479   - // Unenrol link
480 479 if (isguestuser() or !isloggedin()) {
481   - // guest account can not be enrolled
  480 + // guest account can not be enrolled - no links for them
482 481 } else if (is_enrolled($coursecontext)) {
  482 + // unenrol link if possible
483 483 foreach ($instances as $instance) {
484 484 if (!isset($plugins[$instance->enrol])) {
485 485 continue;
@@ -493,6 +493,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
493 493 }
494 494 }
495 495 } else {
  496 + // enrol link if possible
496 497 if (is_viewing($coursecontext)) {
497 498 // better not show any enrol link, this is intended for managers and inspectors
498 499 } else {

0 comments on commit 1b75985

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