Skip to content
Browse files

More tidy ups in displays

  • Loading branch information...
1 parent 0087d8a commit a2ab3b0511e5e4141a0235d9d8967b8e31f8efc2 martin committed Aug 8, 2002
Showing with 31 additions and 25 deletions.
  1. +1 −0 course/lib.php
  2. +27 −24 course/user.php
  3. +2 −0 lang/en/moodle.php
  4. +1 −1 user/view.php
View
1 course/lib.php
@@ -121,6 +121,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
if ($course->category) {
$selector = "WHERE l.course='$course->id' AND l.user = u.id";
+
} else {
$selector = "WHERE l.user = u.id"; // Show all courses
if ($ccc = get_records_sql("SELECT * FROM course ORDER BY fullname")) {
View
51 course/user.php
@@ -7,6 +7,8 @@
require_variable($user); // user id
optional_variable($mode, "outline");
+ $modes = array("outline", "complete", "todaylogs", "alllogs");
+
if (! $course = get_record("course", "id", $id)) {
error("Course id is incorrect.");
}
@@ -24,42 +26,43 @@
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
- print_header("$course->shortname: Activity Report ($mode)", "$course->fullname",
+ $stractivityreport = get_string("activityreport");
+ $strparticipants = get_string("participants");
+ $stroutline = get_string("outline");
+ $strcomplete = get_string("complete");
+ $stralllogs = get_string("alllogs");
+ $strtodaylogs = get_string("todaylogs");
+ $strmode = get_string($mode);
+
+ if ($course->category) {
+ print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
"<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
- <A HREF=\"../user/index.php?id=$course->id\">Participants</A> ->
+ <A HREF=\"../user/index.php?id=$course->id\">$strparticipants</A> ->
<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
- Activity Report ($mode)", "");
+ $stractivityreport -> $strmode");
+ } else {
+ print_header("$course->shortname: $stractivityreport ($mode)", "$course->fullname",
+ "<A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
+ $stractivityreport -> $strmode");
+ }
print_heading("$user->firstname $user->lastname");
echo "<TABLE CELLPADDING=10 ALIGN=CENTER><TR>";
echo "<TD>Reports: </TD>";
- if ($mode != "outline") {
- echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=outline>Outline</A></TD>";
- } else {
- echo "<TD><U>Outline</U></TD>";
- }
- if ($mode != "complete") {
- echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=complete>Complete</A></TD>";
- } else {
- echo "<TD><U>Complete</U></TD>";
- }
- if ($mode != "today") {
- echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=today>Today</A></TD>";
- } else {
- echo "<TD><U>Today</U></TD>";
- }
- if ($mode != "alllogs") {
- echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=alllogs>All logs</A></TD>";
- } else {
- echo "<TD><U>All logs</U></TD>";
+ foreach ($modes as $listmode) {
+ $strmode = get_string($listmode);
+ if ($mode == $listmode) {
+ echo "<TD><U>$strmode</U></TD>";
+ } else {
+ echo "<TD><A HREF=user.php?id=$course->id&user=$user->id&mode=$listmode>$strmode</A></TD>";
+ }
}
echo "</TR></TABLE>";
-
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts);
switch ($mode) {
- case "today" :
+ case "todaylogs" :
echo "<HR><CENTER>";
print_log_graph($course, $user->id, "userday.png", time() );
echo "</CENTER>";
View
2 lang/en/moodle.php
@@ -23,6 +23,7 @@
$string[chooseuser] = "Choose a user";
$string[city] = "City/town";
$string[confirmed] = "Your registration has been confirmed";
+$string[complete] = "Complete";
$string["continue"] = "Continue";
$string[country] = "Country";
$string[course] = "Course";
@@ -190,6 +191,7 @@
$string[ok] = "OK";
$string[opentoguests] = "Open to guests?";
$string[optional] = "optional";
+$string[outline] = "Outline";
$string[participants] = "Participants";
$string[password] = "Password";
$string[passwordchanged] = "Password has been changed";
View
2 user/view.php
@@ -117,7 +117,7 @@
// Print other functions
echo "<CENTER><TABLE ALIGN=CENTER><TR>";
- if (isteacher($course->id) or ($user->id == $USER->id and !isguest()) ) {
+ if ($course->category and (isteacher($course->id) or ($user->id == $USER->id and !isguest())) ) {
echo "<TD NOWRAP><P><FORM ACTION=\"../course/unenrol.php\" METHOD=GET>";
echo "<INPUT type=hidden name=id value=\"$course->id\">";
echo "<INPUT type=hidden name=user value=\"$user->id\">";

0 comments on commit a2ab3b0

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