1. Recent activity reports now activated!
2. Some cleanup of the reports, using boxes
This commit is contained in:
+13
-10
@@ -12,7 +12,7 @@ define('COURSE_MAX_LOGS_PER_PAGE', 1000); // records
|
||||
|
||||
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?
|
||||
|
||||
|
||||
+26
-7
@@ -122,7 +122,11 @@ $advancedfilter = 1;
|
||||
|
||||
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 @@ $advancedfilter = 1;
|
||||
|
||||
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 @@ $advancedfilter = 1;
|
||||
}
|
||||
|
||||
} 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 {
|
||||
|
||||
|
||||
@@ -697,6 +697,7 @@ $string['question'] = 'Question';
|
||||
$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.
|
||||
|
||||
Reference in New Issue
Block a user