]> git.mjollnir.org Git - moodle.git/commitdiff
mnet MDL-18720 pass the right parameters to mnet log functions MDL-18720
authorPenny Leach <penny@mjollnir.org>
Sun, 10 Jan 2010 21:42:41 +0000 (22:42 +0100)
committerPenny Leach <penny@mjollnir.org>
Sun, 10 Jan 2010 21:42:41 +0000 (22:42 +0100)
added some phpdocs and some todos about further documentation

course/lib.php
course/report/log/index.php

index a546bd09db40102302d69fd77a33ce577284fe28..33372fa6a158a07a1c94c036f313ce6d8ad04026 100644 (file)
@@ -122,7 +122,17 @@ function make_log_url($module, $url) {
 }
 
 
-function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='',
+/**
+ * builds up the array of information to draw logs with
+ *
+ * @param int      $hostid   the id of the remote host
+ * @param int      $courseid
+ *
+ * @return array
+ *
+ * @todo document this function - in particular whether the parameters relate to local or remote objects
+ */
+function build_mnet_logs_array($hostid, $courseid, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='',
                    $modname="", $modid=0, $modaction="", $groupid=0) {
     global $CFG, $DB;
 
@@ -431,12 +441,20 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
 }
 
 
+/**
+ * prints the logs shipped over mnet
+ *
+ * @param int      $hostid the id of the remote host
+ * @param stdclass $course
+ *
+ * @todo document this function - in particular whether the parameters relate to local or remote objects
+ */
 function print_mnet_log($hostid, $course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100,
                    $url="", $modname="", $modid=0, $modaction="", $groupid=0) {
 
     global $CFG, $DB, $OUTPUT;
 
-    if (!$logs = build_mnet_logs_array($hostid, $course, $user, $date, $order, $page*$perpage, $perpage,
+    if (!$logs = build_mnet_logs_array($hostid, $course->id, $user, $date, $order, $page*$perpage, $perpage,
                        $modname, $modid, $modaction, $groupid)) {
         echo $OUTPUT->notification("No logs found!");
         echo $OUTPUT->footer();
@@ -3989,4 +4007,4 @@ class course_request {
         $eventdata->smallmessage      = '';
         message_send($eventdata);
     }
-}
\ No newline at end of file
+}
index 7ca593c24987971bcd64260b3e5a093ddd80a542..fc4372bed5d282a93998fbae55d53be015fb58bc 100644 (file)
                             "index.php?id=$course->id&amp;chooselog=1&amp;user=$user&amp;date=$date&amp;modid=$modid&amp;modaction=$modaction&amp;group=$group",
                             $modname, $modid, $modaction, $group);
                 } else {
-                    print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
+                    print_mnet_log($hostid, $course, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
                 }
                 break;
             case 'downloadascsv':