Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes for Log display

  • Loading branch information...
commit 30d6173ed6eb3a646a8aa677de128492f65b6c08 1 parent 7f7f2cc
moodler authored
Showing with 22 additions and 8 deletions.
  1. +5 −3 course/lib.php
  2. +17 −5 course/log.php
View
8 course/lib.php
@@ -17,11 +17,13 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate="today"
$users = array();
if ($course->category) {
- if (!$users = get_course_users($course->id, "u.lastaccess DESC")) {
- $users = array();
+ if ($courseusers = get_course_users($course->id, "u.lastaccess DESC")) {
+ foreach ($courseusers as $courseuser) {
+ $users[$courseuser->id] = "$courseuser->firstname $courseuser->lastname";
+ }
}
if ($guest = get_guest()) {
- $users["$guest->id"] = "$guest->firstname $guest->lastname";
+ $users[$guest->id] = "$guest->firstname $guest->lastname";
}
}
View
22 course/log.php
@@ -26,6 +26,7 @@
}
$strlogs = get_string("logs");
+ $stradministration = get_string("administration");
if ($user || $date) {
@@ -42,9 +43,15 @@
$dateinfo = userdate($date, "%A, %d %B %Y");
}
- print_header("$course->shortname: $strlogs", "$course->fullname",
- "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
- <A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
+ if ($course->category) {
+ print_header("$course->shortname: $strlogs", "$course->fullname",
+ "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> ->
+ <A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
+ } else {
+ print_header("$course->shortname: $strlogs", "$course->fullname",
+ "<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> ->
+ <A HREF=\"log.php?id=$course->id\">$strlogs</A> -> $userinfo, $dateinfo", "");
+ }
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
@@ -53,8 +60,13 @@
print_log($course, $user, $date, "ORDER BY l.time DESC");
} else {
- print_header("$course->shortname: $strlogs", "$course->fullname",
- "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
+ if ($course->category) {
+ print_header("$course->shortname: $strlogs", "$course->fullname",
+ "<A HREF=\"view.php?id=$course->id\">$course->shortname</A> -> $strlogs", "");
+ } else {
+ print_header("$course->shortname: $strlogs", "$course->fullname",
+ "<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A> -> $strlogs", "");
+ }
print_heading(get_string("chooselogs").":");
Please sign in to comment.
Something went wrong with that request. Please try again.