From 0f87cb1d09ae9710a9b2f0cd2a3879e6347d69af Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 23 Feb 2004 18:05:59 +0000 Subject: [PATCH] 1. Recent activity reports now activated! 2. Some cleanup of the reports, using boxes --- course/lib.php | 23 +++++++++++++---------- course/recent.php | 33 ++++++++++++++++++++++++++------- lang/en/moodle.php | 1 + 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/course/lib.php b/course/lib.php index 6b35d9f18e..1f63a08ea7 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 "

"; + + if (empty($USER->lastlogin)) { + echo '

'; print_string("welcometocourse", "", $course->shortname); - echo "

"; + echo '

'; return; - } else { - echo "

"; - echo get_string("yourlastlogin").":
"; - echo userdate($USER->lastlogin, get_string("strftimerecentfull")); - echo "

"; } - + $timestart = $USER->lastlogin; $timemaxrecent = time() - COURSE_MAX_RECENT_PERIOD; if ($timestart < $timemaxrecent) { $timestart = $timemaxrecent; } + echo '
'; + echo get_string("activitysince", "", userdate($timestart)); + + echo '

'.get_string('recentactivityreport').'

'; + + echo '
'; + // Firstly, have there been any new enrolments? diff --git a/course/recent.php b/course/recent.php index 556ad7cf1a..e72336294e 100644 --- a/course/recent.php +++ b/course/recent.php @@ -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 ""; + if ($inbox) { + print_simple_box_end(); + } + } else { diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 17a5e51d7e..22d62d7c1d 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -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'] = '

This page allows you to register your Moodle site with moodle.org. Registration is free. -- 2.39.5