Use $modname if it's defined

This commit is contained in:
moodler
2004-02-14 02:44:35 +00:00
parent d2c3605c83
commit c469a7efb6
2 changed files with 7 additions and 6 deletions
+4 -4
View File
@@ -141,7 +141,7 @@ function print_recent_selector_form($course, $selecteduser=0, $selecteddate="tod
}
function print_log_selector_form($course, $selecteduser=0, $selecteddate="today",
$mod="", $modid=0, $modaction="") {
$modname="", $modid=0, $modaction="") {
global $USER, $CFG;
@@ -278,7 +278,7 @@ function make_log_url($module, $url) {
function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100,
$url="", $mod="", $modid=0, $modaction="") {
$url="", $modname="", $modid=0, $modaction="") {
// It is assumed that $date is the GMT time of midnight for that day,
// and so the next 86400 seconds worth of logs are printed.
@@ -297,8 +297,8 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
}
}
if ($mod) {
$selector .= " AND l.module = '$mod'";
if ($modname) {
$selector .= " AND l.module = '$modname'";
}
if ($modid) {
+3 -2
View File
@@ -7,6 +7,7 @@
require_variable($id); // Course ID
optional_variable($user, 0); // User to display
optional_variable($date, 0); // Date to display
optional_variable($modname, ""); // course_module->id
optional_variable($modid, ""); // course_module->id
optional_variable($modaction, ""); // an action as recorded in the logs
optional_variable($page, "0"); // which page to show
@@ -58,11 +59,11 @@
print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")");
print_log_selector_form($course, $user, $date, "", $modid, $modaction);
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction);
print_log($course, $user, $date, "l.time DESC", $page, $perpage,
"log.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction",
"", $modid, $modaction);
$modname, $modid, $modaction);
} else {
if ($course->category) {