]> git.mjollnir.org Git - moodle.git/commitdiff
Tweaks and cleanups
authormartin <martin>
Thu, 8 Aug 2002 17:29:22 +0000 (17:29 +0000)
committermartin <martin>
Thu, 8 Aug 2002 17:29:22 +0000 (17:29 +0000)
course/lib.php
course/loggraph.php
course/loginas.php
course/user.php

index 7afdf121622afe58115d9b957acf2a1a37f7f954..967d8d27db11b11ec2f8838bbe577fbb9cf353dc 100644 (file)
@@ -497,12 +497,12 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) {
     echo "</TABLE><BR>\n\n";
 }
 
-function print_admin_links () {
+function print_admin_links ($siteid) {
     global $THEME, $CFG;
     
     print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
     $icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
-    $moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$site->id\">".get_string("sitelogs")."</A>";
+    $moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs")."</A>";
     $modicon[]=$icon;
     $moddata[]="<A HREF=\"$CFG->wwwroot/admin/site.php\">".get_string("sitesettings")."</A>";
     $modicon[]=$icon;
index 6b375c28960001a4d10bee64de6779282bc14bfd..b47d980e4bde7a622a813b39f5e8e4b8daead9b8 100644 (file)
@@ -7,7 +7,7 @@
     require_variable($id);    // Course ID
     require_variable($type);  // Graph Type
     optional_variable($user);  // Student ID
-    optional_variable($date);  // Midnight of a date
+    optional_variable($date);  // A time of a day (in GMT)
 
     if (! $course = get_record("course", "id", $id)) {
         error("Course is misconfigured");
index c011b19f0d86840941e9e25adbcdc0bc71ebaff1..be38c15ccac5f9f88bd29490c2655e2cc3b53ced 100644 (file)
@@ -16,7 +16,7 @@
         error("Only teachers can use this page!");
     }
 
-    if (!isstudent($course->id, $user)) {
+    if ($course->category and !isstudent($course->id, $user)) {
         error("This student is not in this course!");
     }
 
index 39995571d9cf85e98977ba4070449373bcad5ee3..0770c76b6733662ffe4d54e8b776ae48753e021e 100644 (file)
@@ -64,7 +64,7 @@
     switch ($mode) {
         case "todaylogs" :
             echo "<HR><CENTER>";
-            print_log_graph($course, $user->id, "userday.png", time() );
+            print_log_graph($course, $user->id, "userday.png");
             echo "</CENTER>";
             print_log($course, $user->id, usergetmidnight(time()), "ORDER BY l.time DESC");
             break;