Example #1
0
     $userinfo = fullname($u, has_capability('moodle/site:viewfullnames', $context));
 }
 if ($date) {
     $dateinfo = userdate($date, get_string('strftimedaydate'));
 }
 switch ($logformat) {
     case 'showashtml':
         if ($hostid != $CFG->mnet_localhost_id || $hostid == $CFG->mnet_localhost_id && $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, "<a href=\"{$CFG->wwwroot}/course/view.php?id={$course->id}\">{$course->shortname}</a> ->\n                                  <a href=\"{$CFG->wwwroot}/course/report.php?id={$course->id}\">{$strreports}</a> ->\n                                  <a href=\"index.php?id={$course->id}\">{$strlogs}</a> -> {$userinfo}, {$dateinfo}", '');
         }
         print_heading(format_string($course->fullname) . ": {$userinfo}, {$dateinfo} (" . usertimezone() . ")");
         print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
         if ($hostid == $CFG->mnet_localhost_id) {
             print_log($course, $user, $date, 'l.time DESC', $page, $perpage, "index.php?id={$course->id}&amp;chooselog=1&amp;user={$user}&amp;date={$date}&amp;modid={$modid}&amp;modaction={$modaction}&amp;group={$group}", $modname, $modid, $modaction, $group);
         } else {
             print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
         }
         break;
     case 'downloadascsv':
         if (!print_log_csv($course, $user, $date, 'l.time DESC', $modname, $modid, $modaction, $group)) {
             notify("No logs found!");
             print_footer($course);
         }
         exit;
     case 'downloadasods':
         if (!print_log_ods($course, $user, $date, 'l.time DESC', $modname, $modid, $modaction, $group)) {
             notify("No logs found!");
Example #2
0
<?php

// $Id: index.php,v 1.4 2007/01/15 07:59:59 vyshane Exp $
require_once '../../../config.php';
require_once $CFG->dirroot . '/course/lib.php';
require_once $CFG->dirroot . '/course/report/log/lib.php';
require_once $CFG->libdir . '/adminlib.php';
$adminroot = admin_get_root();
admin_externalpage_setup('reportlog', $adminroot);
admin_externalpage_print_header($adminroot);
$course = get_site();
print_heading(get_string('chooselogs') . ':');
print_mnet_log_selector_form($CFG->mnet_localhost_id, $course);
echo '<br />';
print_heading(get_string('chooselivelogs') . ':');
$heading = link_to_popup_window('/course/report/log/live.php?id=' . $course->id, 'livelog', get_string('livelogs'), 500, 800, '', 'none', true);
print_heading($heading, 'center', 3);
admin_externalpage_print_footer($adminroot);