define('COURSE_LIVELOG_REFRESH', 60); // Seconds
-define('COURSE_MAX_RECENT_PERIOD', 604800); // A week, in seconds
+define('COURSE_MAX_RECENT_PERIOD', 86400); // A day, in seconds
define('COURSE_MAX_SUMMARIES_PER_PAGE', 10); // courses
$isteacher = isteacher($course->id);
- if (! $USER->lastlogin ) {
- echo "<p align=center><font size=1>";
+
+ if (empty($USER->lastlogin)) {
+ echo '<p align="center"><font size="1">';
print_string("welcometocourse", "", $course->shortname);
- echo "</font></p>";
+ echo '</font></p>';
return;
- } else {
- echo "<p align=center><font size=1>";
- echo get_string("yourlastlogin").":<BR>";
- echo userdate($USER->lastlogin, get_string("strftimerecentfull"));
- echo "</font></p>";
}
-
+
$timestart = $USER->lastlogin;
$timemaxrecent = time() - COURSE_MAX_RECENT_PERIOD;
if ($timestart < $timemaxrecent) {
$timestart = $timemaxrecent;
}
+ echo '<center><font size="1">';
+ echo get_string("activitysince", "", userdate($timestart));
+
+ echo '<p><a href="recent.php?id='.$course->id.'">'.get_string('recentactivityreport').'</a></p>';
+
+ echo '</font></center>';
+
// Firstly, have there been any new enrolments?
if ($i < $course->numsections) {
$activity->type = "section";
- $activity->name = $sectiontitle . " $i";
+ if ($i) {
+ $activity->name = $sectiontitle . " $i";
+ } else {
+ $activity->name = '';
+ }
$activities[$index] = $activity;
}
$index++;
if (!empty($activities)) {
- echo "<ul>";
$newsection = true;
$lastsection = "";
$newinstance = true;
$lastinstance = "";
+ $inbox = false;
$section = 0;
foreach ($activities as $activity) {
-
+
if (($activity->type == "section") && ($sortby == "default")) {
- echo "<h1>$activity->name</h1>";
+ if ($inbox) {
+ print_simple_box_end();
+ print_spacer(30);
+ }
+ print_simple_box_start("center", "90%");
+ echo "<h2>$activity->name</h2>";
+ $inbox = true;
+
} else if ($activity->type == "activity") {
if ($sortby == "default") {
}
} else {
+
+ if (!$inbox) {
+ print_simple_box_start("center", "90%");
+ $inbox = true;
+ }
$print_recent_mod_activity = $activity->type."_print_recent_mod_activity";
if (function_exists($print_recent_mod_activity)) {
- echo "<ul><ul>";
+ echo '<ul><ul>';
$print_recent_mod_activity($activity, $course->id, $detail);
- echo "</ul></ul>";
+ echo '</ul></ul>';
}
}
}
- echo "</ul>";
+ if ($inbox) {
+ print_simple_box_end();
+ }
+
} else {
$string['readinginfofrombackup'] = 'Reading info from backup';
$string['readme'] = 'README';
$string['recentactivity'] = 'Recent activity';
+$string['recentactivityreport'] = 'Full report of recent activity...';
$string['registration'] = 'Moodle Registration';
$string['registrationemail'] = 'Email notifications';
$string['registrationinfo'] = '<p>This page allows you to register your Moodle site with moodle.org. Registration is free.