From: Penny Leach Date: Sun, 10 Jan 2010 21:42:41 +0000 (+0100) Subject: mnet MDL-18720 pass the right parameters to mnet log functions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5179f31ef31927de193fbfb547529e9f6c96274c;p=moodle.git mnet MDL-18720 pass the right parameters to mnet log functions added some phpdocs and some todos about further documentation --- diff --git a/course/lib.php b/course/lib.php index a546bd09db..33372fa6a1 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 +} diff --git a/course/report/log/index.php b/course/report/log/index.php index 7ca593c249..fc4372bed5 100644 --- a/course/report/log/index.php +++ b/course/report/log/index.php @@ -112,7 +112,7 @@ "index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&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':