From 68febe8361bd542e6494d376f25927168e45ef6b Mon Sep 17 00:00:00 2001 From: vyshane Date: Mon, 15 Jan 2007 08:15:04 +0000 Subject: [PATCH] Fixes for MDL-7861. --- course/report/stats/report.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/course/report/stats/report.php b/course/report/stats/report.php index 32ee6d0e7f..f3159a84d4 100644 --- a/course/report/stats/report.php +++ b/course/report/stats/report.php @@ -11,14 +11,17 @@ } } - - echo '
'."\n" - .''."\n"; + // Ugly hack. This file may be included from admin or course reports. + // For admin reports, $adminroot is set. We basically use it to decide + // what kind of footer we need to print. + if (!isset($adminroot)) { + $adminroot = false; + } $reportoptions = stats_get_report_options($course->id, $mode); $timeoptions = report_stats_timeoptions($mode); if (empty($timeoptions)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id); + error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id, $adminroot); } $table->width = '*'; @@ -36,7 +39,7 @@ .' ORDER BY r.sortorder'; if (!$us = get_records_sql($sql)) { - error('Cannot enter detailed view: No users found for this course.'); + error('Cannot enter detailed view: No users found for this course.', $adminroot); } foreach ($us as $u) { @@ -62,13 +65,18 @@ '') ; } + echo ''."\n" + .'
'."\n" + .''."\n"; print_table($table); + + echo '
'; echo '
'; if (!empty($report) && !empty($time)) { if ($report == STATS_REPORT_LOGINS && $course->id != SITEID) { - error("This type of report is only available for the site course"); + error('This type of report is only available for the site course', $adminroot); } $timesql = $param = stats_get_parameters($time,$report,$course->id,$mode); @@ -189,4 +197,4 @@ } } -?> +?> \ No newline at end of file -- 2.39.5