]> git.mjollnir.org Git - moodle.git/commitdiff
1. Recent activity reports now activated!
authormoodler <moodler>
Mon, 23 Feb 2004 18:05:59 +0000 (18:05 +0000)
committermoodler <moodler>
Mon, 23 Feb 2004 18:05:59 +0000 (18:05 +0000)
2. Some cleanup of the reports, using boxes

course/lib.php
course/recent.php
lang/en/moodle.php

index 6b35d9f18e4cd9409a3411ad1da36f087cbe12e3..1f63a08ea7910be993ef7bd08b9506111e8ac260 100644 (file)
@@ -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?
 
index 556ad7cf1a5ae078e72d59c955e5f90f64673ad7..e72336294e53f17d65a9bd9fc10fef432149f36d 100644 (file)
@@ -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 {
 
index 17a5e51d7e5639ed060763e8c3293a6700497fe2..22d62d7c1d7f85368b853f601dd96cfbedc49011 100644 (file)
@@ -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.