Permalink
Browse files

1. Recent activity reports now activated!

2. Some cleanup of the reports, using boxes
  • Loading branch information...
1 parent 6c90bfc commit 0f87cb1d09ae9710a9b2f0cd2a3879e6347d69af moodler committed Feb 23, 2004
Showing with 40 additions and 17 deletions.
  1. +13 −10 course/lib.php
  2. +26 −7 course/recent.php
  3. +1 −0 lang/en/moodle.php
View
@@ -12,7 +12,7 @@
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
@@ -480,24 +480,27 @@ function print_recent_activity($course) {
$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?
View
@@ -122,7 +122,11 @@
if ($i < $course->numsections) {
$activity->type = "section";
- $activity->name = $sectiontitle . " $i";
+ if ($i) {
+ $activity->name = $sectiontitle . " $i";
+ } else {
+ $activity->name = '';
+ }
$activities[$index] = $activity;
}
$index++;
@@ -193,17 +197,24 @@
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") {
@@ -216,18 +227,26 @@
}
} 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 {
View
@@ -697,6 +697,7 @@
$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.

0 comments on commit 0f87cb1

Please sign in to comment.