2004-09-12 12:21:27 +00:00
|
|
|
<?php // $Id$
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-08-11 15:41:54 +00:00
|
|
|
// Display user activity reports for a course
|
|
|
|
|
2003-01-05 14:19:20 +00:00
|
|
|
require_once("../config.php");
|
|
|
|
require_once("lib.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2006-04-12 16:59:51 +00:00
|
|
|
$id = required_param('id',PARAM_INT); // course id
|
|
|
|
$user = required_param('user',PARAM_INT); // user id
|
|
|
|
$mode = optional_param('mode', "todaylogs", PARAM_ALPHA);
|
|
|
|
$page = optional_param('page', 0, PARAM_INT);
|
2005-06-13 19:06:28 +00:00
|
|
|
$perpage = optional_param('perpage', 100, PARAM_INT);
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2008-06-01 18:12:24 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
2008-04-26 11:02:51 +00:00
|
|
|
print_error('invalidcourseid', 'error');
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2007-11-21 16:30:25 +00:00
|
|
|
|
2008-06-02 08:13:24 +00:00
|
|
|
if (! $user = $DB->get_record("user", array("id"=>$user))) {
|
2008-04-26 11:02:51 +00:00
|
|
|
print_error('invaliduserid', 'error');
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2007-11-21 16:30:25 +00:00
|
|
|
|
2008-07-05 14:52:39 +00:00
|
|
|
require_login();
|
2008-11-30 12:04:27 +00:00
|
|
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
|
|
|
$personalcontext = get_context_instance(CONTEXT_USER, $user->id);
|
|
|
|
|
|
|
|
require_login();
|
|
|
|
if (has_capability('moodle/user:viewuseractivitiesreport', $personalcontext) and !has_capability('moodle/course:view', $coursecontext)) {
|
|
|
|
// do not require parents to be enrolled in courses ;-)
|
2009-05-06 08:29:22 +00:00
|
|
|
$PAGE->set_course($course);
|
2008-11-30 12:04:27 +00:00
|
|
|
} else {
|
|
|
|
require_login($course);
|
|
|
|
}
|
2007-09-27 23:37:42 +00:00
|
|
|
|
2008-07-05 14:52:39 +00:00
|
|
|
if ($user->deleted) {
|
|
|
|
print_header();
|
|
|
|
print_heading(get_string('userdeleted'));
|
|
|
|
print_footer();
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2008-11-30 12:04:27 +00:00
|
|
|
// prepare list of allowed modes
|
|
|
|
$myreports = ($course->showreports and $USER->id == $user->id);
|
|
|
|
$anyreport = has_capability('moodle/user:viewuseractivitiesreport', $personalcontext);
|
|
|
|
|
|
|
|
$modes = array();
|
|
|
|
|
|
|
|
if ($myreports or $anyreport or has_capability('coursereport/outline:view', $coursecontext)) {
|
|
|
|
$modes[] = 'outline';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($myreports or $anyreport or has_capability('coursereport/outline:view', $coursecontext)) {
|
|
|
|
$modes[] = 'complete';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($myreports or $anyreport or has_capability('coursereport/log:viewtoday', $coursecontext)) {
|
|
|
|
$modes[] = 'todaylogs';
|
|
|
|
}
|
2006-09-05 08:50:23 +00:00
|
|
|
|
2008-11-30 12:04:27 +00:00
|
|
|
if ($myreports or $anyreport or has_capability('coursereport/log:view', $coursecontext)) {
|
|
|
|
$modes[] = 'alllogs';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($myreports or $anyreport or has_capability('coursereport/stats:view', $coursecontext)) {
|
|
|
|
$modes[] = 'stats';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_capability('moodle/grade:viewall', $coursecontext)) {
|
|
|
|
//ok - can view all course grades
|
|
|
|
$modes[] = 'grade';
|
|
|
|
|
|
|
|
} else if ($course->showgrades and $user->id == $USER->id and has_capability('moodle/grade:view', $coursecontext)) {
|
|
|
|
//ok - can view own grades
|
|
|
|
$modes[] = 'grade';
|
|
|
|
|
|
|
|
} else if ($course->showgrades and has_capability('moodle/grade:viewall', $personalcontext)) {
|
|
|
|
// ok - can view grades of this user - parent most probably
|
|
|
|
$modes[] = 'grade';
|
2008-12-01 19:19:29 +00:00
|
|
|
|
|
|
|
} else if ($course->showgrades and $anyreport) {
|
|
|
|
// ok - can view grades of this user - parent most probably
|
|
|
|
$modes[] = 'grade';
|
2008-11-30 12:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($modes)) {
|
|
|
|
require_capability('moodle/user:viewuseractivitiesreport', $personalcontext);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!in_array($mode, $modes)) {
|
|
|
|
// forbidden or non-exitent mode
|
|
|
|
$mode = reset($modes);
|
2003-10-31 06:45:38 +00:00
|
|
|
}
|
|
|
|
|
2007-08-17 19:09:11 +00:00
|
|
|
add_to_log($course->id, "course", "user report", "user.php?id=$course->id&user=$user->id&mode=$mode", "$user->id");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-08-08 16:22:44 +00:00
|
|
|
$stractivityreport = get_string("activityreport");
|
|
|
|
$strparticipants = get_string("participants");
|
|
|
|
$stroutline = get_string("outline");
|
|
|
|
$strcomplete = get_string("complete");
|
|
|
|
$stralllogs = get_string("alllogs");
|
|
|
|
$strtodaylogs = get_string("todaylogs");
|
|
|
|
$strmode = get_string($mode);
|
2003-11-28 11:06:53 +00:00
|
|
|
$fullname = fullname($user, true);
|
2002-08-08 16:22:44 +00:00
|
|
|
|
2007-08-17 19:09:11 +00:00
|
|
|
$navlinks = array();
|
2007-09-21 07:52:52 +00:00
|
|
|
|
2008-01-10 10:58:16 +00:00
|
|
|
if ($course->id != SITEID && has_capability('moodle/course:viewparticipants', $coursecontext)) {
|
2007-08-17 19:09:11 +00:00
|
|
|
$navlinks[] = array('name' => $strparticipants, 'link' => "../user/index.php?id=$course->id", 'type' => 'misc');
|
2002-08-08 16:22:44 +00:00
|
|
|
}
|
2005-03-20 12:02:14 +00:00
|
|
|
|
2007-08-17 19:09:11 +00:00
|
|
|
$navlinks[] = array('name' => $fullname, 'link' => "../user/view.php?id=$user->id&course=$course->id", 'type' => 'misc');
|
|
|
|
$navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
|
|
|
|
$navlinks[] = array('name' => $strmode, 'link' => null, 'type' => 'misc');
|
|
|
|
$navigation = build_navigation($navlinks);
|
|
|
|
|
|
|
|
print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname, $navigation);
|
|
|
|
|
2005-03-20 12:02:14 +00:00
|
|
|
|
|
|
|
/// Print tabs at top
|
|
|
|
/// This same call is made in:
|
|
|
|
/// /user/view.php
|
|
|
|
/// /user/edit.php
|
|
|
|
/// /course/user.php
|
|
|
|
$currenttab = $mode;
|
2006-08-16 09:11:43 +00:00
|
|
|
$showroles = 1;
|
2005-03-20 12:02:14 +00:00
|
|
|
include($CFG->dirroot.'/user/tabs.php');
|
|
|
|
|
2002-07-23 16:24:12 +00:00
|
|
|
switch ($mode) {
|
2006-08-14 08:46:44 +00:00
|
|
|
case "grade":
|
2007-10-28 17:15:00 +00:00
|
|
|
if (empty($CFG->grade_profilereport) or !file_exists($CFG->dirroot.'/grade/report/'.$CFG->grade_profilereport.'/lib.php')) {
|
|
|
|
$CFG->grade_profilereport = 'user';
|
|
|
|
}
|
|
|
|
require_once $CFG->libdir.'/gradelib.php';
|
|
|
|
require_once $CFG->dirroot.'/grade/lib.php';
|
|
|
|
require_once $CFG->dirroot.'/grade/report/'.$CFG->grade_profilereport.'/lib.php';
|
2007-08-08 07:50:32 +00:00
|
|
|
|
2007-10-28 17:15:00 +00:00
|
|
|
$functionname = 'grade_report_'.$CFG->grade_profilereport.'_profilereport';
|
|
|
|
if (function_exists($functionname)) {
|
|
|
|
$functionname($course, $user);
|
2006-10-31 15:08:22 +00:00
|
|
|
}
|
2006-08-14 08:46:44 +00:00
|
|
|
break;
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2002-08-08 16:22:44 +00:00
|
|
|
case "todaylogs" :
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '<div class="graph">';
|
2002-08-08 17:29:22 +00:00
|
|
|
print_log_graph($course, $user->id, "userday.png");
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '</div>';
|
2007-08-17 19:09:11 +00:00
|
|
|
print_log($course, $user->id, usergetmidnight(time()), "l.time DESC", $page, $perpage,
|
2004-09-16 17:13:57 +00:00
|
|
|
"user.php?id=$course->id&user=$user->id&mode=$mode");
|
2002-07-27 09:44:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case "alllogs" :
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '<div class="graph">';
|
2002-07-27 09:44:01 +00:00
|
|
|
print_log_graph($course, $user->id, "usercourse.png");
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '</div>';
|
2007-08-17 19:09:11 +00:00
|
|
|
print_log($course, $user->id, 0, "l.time DESC", $page, $perpage,
|
2004-09-16 17:13:57 +00:00
|
|
|
"user.php?id=$course->id&user=$user->id&mode=$mode");
|
2002-07-23 16:24:12 +00:00
|
|
|
break;
|
2005-09-01 04:14:31 +00:00
|
|
|
case 'stats':
|
|
|
|
|
|
|
|
if (empty($CFG->enablestats)) {
|
2008-04-26 11:02:51 +00:00
|
|
|
print_error('statsdisable', 'error');
|
2005-09-01 04:14:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require_once($CFG->dirroot.'/lib/statslib.php');
|
|
|
|
|
2006-07-03 15:43:41 +00:00
|
|
|
$statsstatus = stats_check_uptodate($course->id);
|
|
|
|
if ($statsstatus !== NULL) {
|
|
|
|
notify ($statsstatus);
|
|
|
|
}
|
2005-09-28 06:07:40 +00:00
|
|
|
|
2008-06-02 08:13:24 +00:00
|
|
|
$earliestday = $DB->get_field_sql('SELECT timeend FROM {stats_user_daily} ORDER BY timeend');
|
2008-06-04 23:56:34 +00:00
|
|
|
$earliestweek = $DB->get_field_sql('SELECT timeend FROM {stats_user_weekly} ORDER BY timeend');
|
2008-06-02 08:13:24 +00:00
|
|
|
$earliestmonth = $DB->get_field_sql('SELECT timeend FROM {stats_user_monthly} ORDER BY timeend');
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-09-01 04:14:31 +00:00
|
|
|
if (empty($earliestday)) $earliestday = time();
|
|
|
|
if (empty($earliestweek)) $earliestweek = time();
|
|
|
|
if (empty($earliestmonth)) $earliestmonth = time();
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-09-01 04:14:31 +00:00
|
|
|
$now = stats_get_base_daily();
|
|
|
|
$lastweekend = stats_get_base_weekly();
|
|
|
|
$lastmonthend = stats_get_base_monthly();
|
|
|
|
|
|
|
|
$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
|
|
|
|
|
2007-08-17 19:09:11 +00:00
|
|
|
if (empty($timeoptions)) {
|
2008-04-04 02:54:20 +00:00
|
|
|
print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline');
|
2005-09-01 04:14:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// use the earliest.
|
2005-10-13 03:16:11 +00:00
|
|
|
$time = array_pop(array_keys($timeoptions));
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-10-16 20:55:40 +00:00
|
|
|
$param = stats_get_parameters($time,STATS_REPORT_USER_VIEW,$course->id,STATS_MODE_DETAILED);
|
2008-06-02 08:13:24 +00:00
|
|
|
$params = $param->params;
|
2005-09-01 04:14:31 +00:00
|
|
|
|
|
|
|
$param->table = 'user_'.$param->table;
|
2005-10-16 20:55:40 +00:00
|
|
|
|
2008-06-02 08:13:24 +00:00
|
|
|
$sql = 'SELECT timeend,'.$param->fields.' FROM {stats_'.$param->table.'} WHERE '
|
2005-10-13 03:16:11 +00:00
|
|
|
.(($course->id == SITEID) ? '' : ' courseid = '.$course->id.' AND ')
|
2008-06-02 08:13:24 +00:00
|
|
|
.' userid = '.$user->id.' AND timeend >= '.$param->timeafter .$param->extras
|
2005-09-01 04:14:31 +00:00
|
|
|
.' ORDER BY timeend DESC';
|
2008-06-02 08:13:24 +00:00
|
|
|
$stats = $DB->get_records_sql($sql, $params); //TODO: improve these params!!
|
2005-10-13 03:16:11 +00:00
|
|
|
|
|
|
|
if (empty($stats)) {
|
2008-04-04 02:54:20 +00:00
|
|
|
print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline');
|
2005-10-13 03:16:11 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2007-08-16 04:05:31 +00:00
|
|
|
// MDL-10818, do not display broken graph when user has no permission to view graph
|
2008-11-30 12:04:27 +00:00
|
|
|
if ($myreports or has_capability('coursereport/stats:view', $coursecontext)) {
|
2007-08-16 04:05:31 +00:00
|
|
|
echo '<center><img src="'.$CFG->wwwroot.'/course/report/stats/graph.php?mode='.STATS_MODE_DETAILED.'&course='.$course->id.'&time='.$time.'&report='.STATS_REPORT_USER_VIEW.'&userid='.$user->id.'" alt="'.get_string('statisticsgraph').'" /></center>';
|
|
|
|
}
|
2005-10-16 20:55:40 +00:00
|
|
|
|
2006-10-23 05:22:16 +00:00
|
|
|
// What the heck is this about? -- MD
|
2005-10-16 20:55:40 +00:00
|
|
|
$stats = stats_fix_zeros($stats,$param->timeafter,$param->table,(!empty($param->line2)),(!empty($param->line3)));
|
2006-10-23 05:22:16 +00:00
|
|
|
|
2005-09-01 04:14:31 +00:00
|
|
|
$table = new object();
|
|
|
|
$table->align = array('left','center','center','center');
|
|
|
|
$param->table = str_replace('user_','',$param->table);
|
2008-02-16 18:33:50 +00:00
|
|
|
switch ($param->table) {
|
|
|
|
case 'daily' : $period = get_string('day'); break;
|
|
|
|
case 'weekly' : $period = get_string('week'); break;
|
|
|
|
case 'monthly': $period = get_string('month', 'form'); break;
|
|
|
|
default : $period = '';
|
|
|
|
}
|
|
|
|
$table->head = array(get_string('periodending','moodle',$period),$param->line1,$param->line2,$param->line3);
|
2006-10-23 05:22:16 +00:00
|
|
|
foreach ($stats as $stat) {
|
|
|
|
if (!empty($stat->zerofixed)) { // Don't know why this is necessary, see stats_fix_zeros above - MD
|
|
|
|
continue;
|
|
|
|
}
|
2005-10-28 01:36:59 +00:00
|
|
|
$a = array(userdate($stat->timeend,get_string('strftimedate'),$CFG->timezone),$stat->line1);
|
2005-09-01 04:14:31 +00:00
|
|
|
$a[] = $stat->line2;
|
|
|
|
$a[] = $stat->line3;
|
|
|
|
$table->data[] = $a;
|
|
|
|
}
|
|
|
|
print_table($table);
|
|
|
|
break;
|
2008-11-30 12:04:27 +00:00
|
|
|
|
2002-07-23 16:24:12 +00:00
|
|
|
case "outline" :
|
|
|
|
case "complete" :
|
2008-11-30 12:04:27 +00:00
|
|
|
get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
2002-07-23 16:24:12 +00:00
|
|
|
$sections = get_all_sections($course->id);
|
2002-05-31 09:34:50 +00:00
|
|
|
|
2002-07-23 16:24:12 +00:00
|
|
|
for ($i=0; $i<=$course->numsections; $i++) {
|
|
|
|
|
|
|
|
if (isset($sections[$i])) { // should always be true
|
|
|
|
|
|
|
|
$section = $sections[$i];
|
2006-10-22 20:03:01 +00:00
|
|
|
$showsection = (has_capability('moodle/course:viewhiddensections', $coursecontext) or $section->visible or !$course->hiddensections);
|
2002-07-23 16:24:12 +00:00
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
if ($showsection) { // prevent hidden sections in user activity. Thanks to Geoff Wilbert!
|
2002-07-23 16:24:12 +00:00
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
if ($section->sequence) {
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '<div class="section">';
|
|
|
|
echo '<h2>';
|
2004-11-16 17:30:45 +00:00
|
|
|
switch ($course->format) {
|
|
|
|
case "weeks": print_string("week"); break;
|
|
|
|
case "topics": print_string("topic"); break;
|
|
|
|
default: print_string("section"); break;
|
2003-01-14 14:56:57 +00:00
|
|
|
}
|
2004-11-16 17:30:45 +00:00
|
|
|
echo " $i</h2>";
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '<div class="content">';
|
2004-10-02 15:29:49 +00:00
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
if ($mode == "outline") {
|
|
|
|
echo "<table cellpadding=\"4\" cellspacing=\"0\">";
|
2004-10-02 15:29:49 +00:00
|
|
|
}
|
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
$sectionmods = explode(",", $section->sequence);
|
|
|
|
foreach ($sectionmods as $sectionmod) {
|
|
|
|
if (empty($mods[$sectionmod])) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$mod = $mods[$sectionmod];
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
if (empty($mod->visible)) {
|
|
|
|
continue;
|
|
|
|
}
|
2002-07-25 13:47:11 +00:00
|
|
|
|
2008-06-02 08:13:24 +00:00
|
|
|
$instance = $DB->get_record("$mod->modname", array("id"=>$mod->instance));
|
2004-11-16 17:30:45 +00:00
|
|
|
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
|
|
|
|
|
|
|
|
if (file_exists($libfile)) {
|
|
|
|
require_once($libfile);
|
|
|
|
|
|
|
|
switch ($mode) {
|
|
|
|
case "outline":
|
|
|
|
$user_outline = $mod->modname."_user_outline";
|
|
|
|
if (function_exists($user_outline)) {
|
|
|
|
$output = $user_outline($course, $user, $mod, $instance);
|
|
|
|
print_outline_row($mod, $instance, $output);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "complete":
|
|
|
|
$user_complete = $mod->modname."_user_complete";
|
|
|
|
if (function_exists($user_complete)) {
|
|
|
|
$image = "<img src=\"../mod/$mod->modname/icon.gif\" ".
|
2007-01-08 09:14:05 +00:00
|
|
|
"class=\"icon\" alt=\"$mod->modfullname\" />";
|
2004-11-16 17:30:45 +00:00
|
|
|
echo "<h4>$image $mod->modfullname: ".
|
|
|
|
"<a href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
|
2005-04-14 22:41:19 +00:00
|
|
|
format_string($instance->name,true)."</a></h4>";
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2006-04-12 06:56:01 +00:00
|
|
|
ob_start();
|
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
echo "<ul>";
|
|
|
|
$user_complete($course, $user, $mod, $instance);
|
|
|
|
echo "</ul>";
|
2006-04-12 06:56:01 +00:00
|
|
|
|
|
|
|
$output = ob_get_contents();
|
2006-05-23 10:55:32 +00:00
|
|
|
ob_end_clean();
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2006-04-12 06:56:01 +00:00
|
|
|
if (str_replace(' ', '', $output) != '<ul></ul>') {
|
|
|
|
echo $output;
|
|
|
|
}
|
2004-11-16 17:30:45 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-07-25 13:47:11 +00:00
|
|
|
}
|
2004-11-16 17:30:45 +00:00
|
|
|
}
|
2002-07-23 16:24:12 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2004-11-16 17:30:45 +00:00
|
|
|
if ($mode == "outline") {
|
|
|
|
echo "</table>";
|
2002-07-23 16:24:12 +00:00
|
|
|
}
|
2005-03-20 12:02:14 +00:00
|
|
|
echo '</div>'; // content
|
|
|
|
echo '</div>'; // section
|
2002-07-23 16:24:12 +00:00
|
|
|
}
|
|
|
|
}
|
2002-05-31 09:34:50 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
2002-07-23 16:24:12 +00:00
|
|
|
break;
|
2008-11-30 12:04:27 +00:00
|
|
|
default:
|
|
|
|
// can not be reached ;-)
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2002-07-23 16:24:12 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
print_footer($course);
|
|
|
|
|
2002-07-23 16:24:12 +00:00
|
|
|
|
2002-07-25 13:47:11 +00:00
|
|
|
function print_outline_row($mod, $instance, $result) {
|
2006-03-09 09:49:34 +00:00
|
|
|
global $CFG;
|
|
|
|
|
2007-01-08 09:14:05 +00:00
|
|
|
$image = "<img src=\"$CFG->modpixpath/$mod->modname/icon.gif\" class=\"icon\" alt=\"$mod->modfullname\" />";
|
2004-09-12 12:21:27 +00:00
|
|
|
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td valign=\"top\">$image</td>";
|
2007-02-06 08:24:37 +00:00
|
|
|
echo "<td valign=\"top\" style=\"width:300\">";
|
2004-09-12 12:21:27 +00:00
|
|
|
echo " <a title=\"$mod->modfullname\"";
|
2005-04-14 22:41:19 +00:00
|
|
|
echo " href=\"../mod/$mod->modname/view.php?id=$mod->id\">".format_string($instance->name,true)."</a></td>";
|
2004-09-12 12:21:27 +00:00
|
|
|
echo "<td> </td>";
|
2005-06-23 20:14:46 +00:00
|
|
|
echo "<td valign=\"top\">";
|
2002-07-25 13:47:11 +00:00
|
|
|
if (isset($result->info)) {
|
|
|
|
echo "$result->info";
|
|
|
|
} else {
|
2007-02-06 08:24:37 +00:00
|
|
|
echo "<p style=\"text-align:center\">-</p>";
|
2002-07-25 13:47:11 +00:00
|
|
|
}
|
2004-09-12 12:21:27 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "<td> </td>";
|
2005-09-09 16:17:43 +00:00
|
|
|
if (!empty($result->time)) {
|
2002-07-25 13:47:11 +00:00
|
|
|
$timeago = format_time(time() - $result->time);
|
2007-02-06 08:24:37 +00:00
|
|
|
echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time)." ($timeago)</td>";
|
2002-07-25 13:47:11 +00:00
|
|
|
}
|
2004-09-12 12:21:27 +00:00
|
|
|
echo "</tr>";
|
2002-07-23 16:24:12 +00:00
|
|
|
}
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|