$strftimedatetime = get_string("strftimedatetime");
- echo "<p align=\"center\">\n";
+ echo "<div class=\"info\">\n";
print_string("displayingrecords", "", $totalcount);
- echo "</p>\n";
+ echo "</div>\n";
print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&");
- echo "<table class=\"logtable\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\">\n";
+ echo "<table class=\"logtable\" cellpadding=\"3\" cellspacing=\"0\" summary=\"\">\n";
echo "<tr>";
if ($course->id == SITEID) {
echo "<th class=\"c0 header\" scope=\"col\">".get_string('course')."</th>\n";
echo '<tr class="r'.$row.'">';
if ($course->id == SITEID) {
- echo "<td class=\"r$row c0\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c0\">\n";
echo " <a href=\"{$CFG->wwwroot}/course/view.php?id={$log->course}\">".$courses[$log->course]."</a>\n";
echo "</td>\n";
}
- echo "<td class=\"r$row c1\" nowrap=\"nowrap\" align=\"right\">".userdate($log->time, '%a').
+ echo "<td class=\"r$row c1\" align=\"right\">".userdate($log->time, '%a').
' '.userdate($log->time, $strftimedatetime)."</td>\n";
- echo "<td class=\"r$row c2\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c2\">\n";
link_to_popup_window("/iplookup/index.php?ip=$log->ip&user=$log->userid", 'iplookup',$log->ip, 400, 700);
echo "</td>\n";
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
- echo "<td class=\"r$row c3\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c3\">\n";
echo " <a href=\"$CFG->wwwroot/user/view.php?id={$log->userid}&course={$log->course}\">$fullname</a>\n";
echo "</td>\n";
- echo "<td class=\"r$row c4\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c4\">\n";
link_to_popup_window( make_log_url($log->module,$log->url), 'fromloglive',"$log->module $log->action", 400, 600);
echo "</td>\n";;
- echo "<td class=\"r$row c5\" nowrap=\"nowrap\">{$log->info}</td>\n";
+ echo "<td class=\"r$row c5\">{$log->info}</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
$strftimedatetime = get_string("strftimedatetime");
- echo "<p align=\"center\">\n";
+ echo "<div class=\"info\">\n";
print_string("displayingrecords", "", $totalcount);
- echo "</p>\n";
+ echo "</div>\n";
print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&");
- echo "<table class=\"logtable\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\">\n";
+ echo "<table class=\"logtable\" cellpadding=\"3\" cellspacing=\"0\">\n";
echo "<tr>";
if ($course->id == SITEID) {
echo "<th class=\"c0 header\">".get_string('course')."</th>\n";
echo '<tr class="r'.$row.'">';
if ($course->id == SITEID) {
- echo "<td class=\"r$row c0\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c0\" >\n";
echo " <a href=\"{$CFG->wwwroot}/course/view.php?id={$log->course}\">".$courses[$log->course]."</a>\n";
echo "</td>\n";
}
- echo "<td class=\"r$row c1\" nowrap=\"nowrap\" align=\"right\">".userdate($log->time, '%a').
+ echo "<td class=\"r$row c1\" align=\"right\">".userdate($log->time, '%a').
' '.userdate($log->time, $strftimedatetime)."</td>\n";
- echo "<td class=\"r$row c2\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c2\" >\n";
link_to_popup_window("/iplookup/index.php?ip=$log->ip&user=$log->userid", 'iplookup',$log->ip, 400, 700);
echo "</td>\n";
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
- echo "<td class=\"r$row c3\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c3\" >\n";
echo " <a href=\"$CFG->wwwroot/user/view.php?id={$log->userid}\">$fullname</a>\n";
echo "</td>\n";
- echo "<td class=\"r$row c4\" nowrap=\"nowrap\">\n";
+ echo "<td class=\"r$row c4\">\n";
echo $log->action .': '.$log->module;
echo "</td>\n";;
- echo "<td class=\"r$row c5\" nowrap=\"nowrap\">{$log->info}</td>\n";
+ echo "<td class=\"r$row c5\">{$log->info}</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
if (has_capability('moodle/site:viewreports', $sitecontext) && $showcourses) {
if ($ccc = get_records("course", "", "", "fullname","id,fullname,category")) {
foreach ($ccc as $cc) {
- if ($cc->category) {
- $courses["$hostid/$cc->id"] = "- $cc->fullname";
+ if ($cc->id == SITEID) {
+ $sites["$hostid/$cc->id"] = $cc->fullname.' ('.get_string('site').')';
} else {
- $sites["$hostid/$cc->id"] = "$cc->fullname Site";
+ $courses["$hostid/$cc->id"] = $cc->fullname;
}
}
}
$sql = "select distinct course, coursename from mdl_mnet_log where hostid = '$hostid'";
if ($ccc = get_records_sql($sql)) {
foreach ($ccc as $cc) {
- if (1 == $cc->course) {
- $sites["$hostid/$cc->course"] = "$cc->coursename Site";
+ if (1 == $cc->course) { // TODO: this might be wrong - site course may have another id
+ $sites["$hostid/$cc->course"] = $cc->coursename.' ('.get_string('site').')';
} else {
- $courses["$hostid/$cc->course"] = "- $cc->coursename";
+ $courses["$hostid/$cc->course"] = $cc->coursename;
}
}
}
$selecteddate = $today;
}
- $cid = empty($course->id)? '1' : $course->id;
- echo "<form class=\"mform\" action=\"$CFG->wwwroot/course/report/log/index.php\" method=\"get\">\n";
- echo "<fieldset class=\"invisiblefieldset boxaligncenter\">\n";
+ echo "<form class=\"logselectform\" action=\"$CFG->wwwroot/course/report/log/index.php\" method=\"get\">\n";
+ echo "<div>\n";//invisible fieldset here breaks wrapping
echo "<input type=\"hidden\" name=\"chooselog\" value=\"1\" />\n";
echo "<input type=\"hidden\" name=\"showusers\" value=\"$showusers\" />\n";
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
choose_from_menu_nested($dropdown, "host_course", $hostid.'/'.$cid, "");
} else {
$courses = array();
- $courses[$course->id] = $course->fullname . ((empty($course->category)) ? ' (Site) ' : '');
+ $courses[$course->id] = $course->fullname . ((empty($course->category)) ? ' ('.get_string('site').') ' : '');
choose_from_menu($courses,"id",$course->id,false);
if (has_capability('moodle/site:viewreports', $sitecontext)) {
+ $a = new object();
$a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser"
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers";
print_string('logtoomanycourses','moodle',$a);
print_string('logtoomanyusers','moodle',$a);
}
choose_from_menu ($dates, "date", $selecteddate, get_string("alldays"));
- echo '<br />';
choose_from_menu ($activities, "modid", $selectedactivity, get_string("allactivities"), "", "");
choose_from_menu ($actions, 'modaction', $modaction, get_string("allactions"));
$logformats = array('showashtml' => get_string('displayonpage'),
'downloadascsv' => get_string('downloadtext'),
+ 'downloadasods' => get_string('downloadods'),
'downloadasexcel' => get_string('downloadexcel'));
- /*
- $logformats = array('showashtml' => get_string('displayonpage'),
- 'downloadascsv' => get_string('downloadtext'),
- 'downloadasexcel' => get_string('downloadexcel'),
- 'downloadasooo' => get_string('downloadasooo'));
- */
choose_from_menu ($logformats, 'logformat', $logformat, false);
echo '<input type="submit" value="'.get_string('gettheselogs').'" />';
- echo '</fieldset>';
- echo "</form>";
+ echo '</div>';
+ echo '</form>';
}
function print_log_selector_form($course, $selecteduser=0, $selecteddate='today',
$selecteddate = $today;
}
- echo "<center>\n";
- echo "<form action=\"$CFG->wwwroot/course/report/log/index.php\" method=\"get\">\n";
+ echo "<form class=\"logselectform\" action=\"$CFG->wwwroot/course/report/log/index.php\" method=\"get\">\n";
+ echo "<div>\n";
echo "<input type=\"hidden\" name=\"chooselog\" value=\"1\" />\n";
echo "<input type=\"hidden\" name=\"showusers\" value=\"$showusers\" />\n";
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
} else {
// echo '<input type="hidden" name="id" value="'.$course->id.'" />';
$courses = array();
- $courses[$course->id] = $course->fullname . (($course->id == SITEID) ? ' (Site) ' : '');
+ $courses[$course->id] = $course->fullname . (($course->id == SITEID) ? ' ('.get_string('site').') ' : '');
choose_from_menu($courses,"id",$course->id,false);
if (has_capability('moodle/site:viewreports', $sitecontext)) {
+ $a = new object();
$a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser"
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers";
print_string('logtoomanycourses','moodle',$a);
$users[0] = get_string('allparticipants');
}
choose_from_menu($users, 'user', $selecteduser, false);
+ $a = new object();
$a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser"
."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses";
print_string('logtoomanyusers','moodle',$a);
'downloadasexcel' => get_string('downloadexcel'));
choose_from_menu ($logformats, 'logformat', $logformat, false);
echo '<input type="submit" value="'.get_string('gettheselogs').'" />';
- echo "</form>";
- echo "</center>";
+ echo '</div>';
+ echo '</form>';
}
?>
print_log_selector_form($course);
- echo '<br />';
- echo '<div style="text-align:center;">';
print_heading(get_string('chooselivelogs') .':');
+ echo '<p>';
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
- echo '</div>';
- echo '<br />';
+ echo '</p>';
?>
\ No newline at end of file
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
- echo '<p style="text-align:center;">';
+ echo '<p>';
$activityreport = get_string( 'activityreport' );
echo "<a href=\"{$CFG->wwwroot}/course/report/outline/index.php?id={$course->id}\">";
echo "$activityreport</a>\n";
$useroptions[$r->id] = $r->name;
}
}
+ $guestrole = get_guest_role();
+ if (empty($useroptions[$gusetrole->id])) {
+ $useroptions[$guestrole->id] = $guestrole->name;
+ }
$actionoptions = array('' => $strallactions,
'view' => $strview,
'post' => $strpost,
// print first controls.
- echo '<form action="index.php" method="get">'."\n".
- '<input type="hidden" name="id" value="'.$course->id.'" />'."\n".
- '<input type="hidden" name="oldmod" value="'.$moduleid.'" />'."\n".
- '<input type="hidden" name="instanceid" value="'.$instanceid.'" />'."\n".
- '<table align="center" cellpadding="10"><tr>'."\n".
- "<td>\n".
- get_string('activitymodule').' ';
+ echo '<form class="participationselectform" action="index.php" method="get"><div>'."\n".
+ '<input type="hidden" name="id" value="'.$course->id.'" />'."\n".
+ '<input type="hidden" name="oldmod" value="'.$moduleid.'" />'."\n".
+ '<input type="hidden" name="instanceid" value="'.$instanceid.'" />';
+ echo '<label for="menumoduleid">'.get_string('activitymodule').'</label>';
choose_from_menu($modoptions,'moduleid',$moduleid);
- echo "</td><td>\n".
- get_string('lookback').' ';
+ echo '<label for="menutimefrom">'.get_string('lookback').'</label>';
choose_from_menu($timeoptions,'timefrom',$timefrom);
- echo "</td><td>".
- get_string('showonly').' ';
+ echo '<label for="menuroleid">'.get_string('showonly').'</label>';
choose_from_menu($useroptions,'roleid',$roleid,'');
- echo "</td><td>\n".
- get_string('showactions'),' ';
+ echo '<label for="menuaction">'.get_string('showactions').'</label>';
choose_from_menu($actionoptions,'action',$action,'');
- echo '</td><td>';
helpbutton('participationreport',get_string('participationreport'));
- echo
- '<input type="submit" value="'.get_string('go').'" />'."\n".
- "</td></tr></table>\n".
- "</form>\n";
+ echo '<input type="submit" value="'.get_string('go').'" />'."\n</div></form>\n";
if (empty($moduleid)) {
notify(get_string('selectamodule'));
$useroptions[$role->id] = $role->name;
}
}
+ $guestrole = get_guest_role();
+ if (empty($useroptions[$gusetrole->id])) {
+ $useroptions[$guestrole->id] = $guestrole->name;
+ }
$actionoptions = array('' => $strallactions,
'view' => $strview,
'post' => $strpost,
// print first controls.
- echo '<form action="'.$CFG->wwwroot.'/course/report/participation/index.php" method="get">'."\n".
- '<input type="hidden" name="id" value="'.$course->id.'" />'."\n".
- '<table align="center" cellpadding="10"><tr>'."\n".
- "<td>\n".
- get_string('activitymodule').' ';
+ echo '<form class="participationselectform" action="'.$CFG->wwwroot.'/course/report/participation/index.php" method="get"><div>'."\n".
+ '<input type="hidden" name="id" value="'.$course->id.'" />'."\n";
+ echo '<label for="menumoduleid">'.get_string('activitymodule').'</label>';
choose_from_menu($modoptions,'moduleid',0);
- echo "</td><td>\n".
- get_string('lookback').' ';
+ echo '<label for="menutimefrom">'.get_string('lookback').'</label>';
choose_from_menu($timeoptions,'timefrom',0);
- echo "</td><td>".
- get_string('showonly').' ';
+ echo '<label for="menuroleid">'.get_string('showonly').'</label>';
choose_from_menu($useroptions,'roleid',0,'');
- echo "</td><td>\n".
- get_string('showactions'),' ';
+ echo '<label for="menuaction">'.get_string('showactions').'</label>';
choose_from_menu($actionoptions,'action',0,'');
- echo '</td><td>';
helpbutton('participationreport',get_string('participationreport'));
- echo
- '<input type="submit" value="'.get_string('go').'" />'."\n".
- "</td></tr></table>\n".
- "</form>\n";
+ echo '<input type="submit" value="'.get_string('go').'" />'."\n</div></form>\n";
?>
}
if (!empty($CFG->enablestats)) {
- echo '<p style="text-align:center;">';
+ echo '<p>';
echo '<a href="'.$CFG->wwwroot.'/course/report/stats/index.php?course='.$course->id.'">'.get_string('stats').'</a>';
echo '</p>';
+ } else {
+ echo '<p>';
+ echo get_string('statsoff');
+ echo '</p>';
}
?>
blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$PAGE->print_header();
- echo '<table id="layout-table"><tr>';
+ echo '<table id="layout-table" summary=""><tr>';
echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
echo '</td>';
}
+#course-report #content {
+ padding-top:15px;
+ padding-bottom:15px;
+}
+
+#course-report p {
+ text-align:center;
+}
+
+#course-report .logselectform,
+#course-report .participationselectform,
+#course-report-log-index .logselectform,
+#course-report-participation-index .participationselectform {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:center;
+ margin-top:10px;
+ margin-bottom:10px;
+}
+
+#course-report .participationselectform label,
+#course-report-participation-index .participationselectform label {
+ margin-left:15px;
+ margin-right:5px;
+}
+
+#course-report-log-index .info {
+ margin-left:auto;
+ margin-right:auto;
+ text-align:center;
+ margin:10px;
+}
+
+#course-report-log-index .logtable {
+ margin-left:auto;
+ margin-right:auto;
+}
+
+
+
/***
*** Doc
***/