adding some strings
[moodle-linuxchix.git] / course / report / log / live.php
bloba1c89b76befba7b25b49d1931ab6de6998865abf
1 <?php // $Id$
2 // Displays live view of recent logs
4 require_once("../../../config.php");
5 require_once("../../lib.php");
7 $id = required_param('id', PARAM_INT);
8 $page = optional_param('page', 0, PARAM_INT); // which page to show
10 require_login();
12 if (! $course = get_record("course", "id", $id) ) {
13 error("That's an invalid course id");
16 $context = get_context_instance(CONTEXT_COURSE, $course->id);
17 if (!has_capability('moodle/site:viewreports', $context)) {
18 error('You need do not have the required permission to view this report');
21 add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id);
23 session_write_close();
25 // we override the default framename so header/footer
26 // links open in a new window
27 if (empty($CFG->framename) || $CFG->framename==='_top') {
28 $CFG->framename = '_blank';
31 $strlivelogs = get_string("livelogs");
32 $strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
34 print_header("$strlivelogs ($strupdatesevery)", "$strlivelogs", "", "",
35 '<meta http-equiv="Refresh" content="'.COURSE_LIVELOG_REFRESH.'; url=live.php?id='.$course->id.'" />');
37 $user=0;
38 $date=time() - 3600;
40 print_log($course, $user, $date, "l.time DESC", $page, 500,
41 "live.php?id=$course->id&amp;user=$user&amp;date=$date");
43 print_footer('none');
45 exit;