From: moodler Date: Wed, 27 Sep 2006 09:22:29 +0000 (+0000) Subject: FIxed up log headers etc MDL-6714 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4e03aa7a00728c428afdb2a1d05c3dadb380322d;p=moodle.git FIxed up log headers etc MDL-6714 --- diff --git a/course/report/log/index.php b/course/report/log/index.php index 8504157812..f14862d019 100644 --- a/course/report/log/index.php +++ b/course/report/log/index.php @@ -4,6 +4,7 @@ require_once('../../../config.php'); require_once('../../lib.php'); require_once('lib.php'); + require_once($CFG->libdir.'/adminlib.php'); $id = required_param('id', PARAM_INT);// Course ID $group = optional_param('group', -1, PARAM_INT); // Group to display @@ -26,9 +27,8 @@ } $context = get_context_instance(CONTEXT_COURSE, $course->id); - if (!has_capability('moodle/site:viewreports', $context)) { - error('You need do not have the required permission to view this report'); - } + + require_capability('moodle/site:viewreports', $context); add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id); @@ -54,16 +54,16 @@ switch ($logformat) { case 'showashtml': - if ($course->category) { + if ($course->id == SITEID) { + $adminroot = admin_get_root(); + admin_externalpage_setup('reportlog', $adminroot); + admin_externalpage_print_header($adminroot); + + } else { print_header($course->shortname .': '. $strlogs, $course->fullname, "wwwroot/course/view.php?id=$course->id\">$course->shortname -> wwwroot/course/report.php?id=$course->id\">$strreports -> id\">$strlogs -> $userinfo, $dateinfo", ''); - } else { - print_header($course->shortname .': '. $strlogs, $course->fullname, - "wwwroot/$CFG->admin/index.php\">$stradministration -> - wwwroot/$CFG->admin/report.php\">$strreports -> - id\">$strlogs -> $userinfo, $dateinfo", ''); } print_heading("$course->fullname: $userinfo, $dateinfo (".usertimezone().")"); @@ -100,16 +100,15 @@ } else { - if ($course->category) { + if ($course->id == SITEID) { + $adminroot = admin_get_root(); + admin_externalpage_setup('reportlog', $adminroot); + admin_externalpage_print_header($adminroot); + } else { print_header($course->shortname .': '. $strlogs, $course->fullname, "wwwroot/course/view.php?id=$course->id\">$course->shortname -> wwwroot/course/report.php?id=$course->id\">$strreports -> $strlogs", ''); - } else { - print_header($course->shortname .': '. $strlogs, $course->fullname, - "wwwroot/$CFG->admin/index.php\">$stradministration -> - wwwroot/$CFG->admin/report.php\">$strreports -> - $strlogs", ''); } print_heading(get_string('chooselogs') .':'); @@ -125,7 +124,11 @@ } - print_footer($course); + if ($course->id == SITEID) { + admin_externalpage_print_footer($adminroot); + } else { + print_footer($course); + } exit; -?> \ No newline at end of file +?>