]> git.mjollnir.org Git - moodle.git/commitdiff
Added a hook when printing recent activity. If the Library
authormoodler <moodler>
Tue, 26 Aug 2003 18:45:54 +0000 (18:45 +0000)
committermoodler <moodler>
Tue, 26 Aug 2003 18:45:54 +0000 (18:45 +0000)
module is activated, then a Library function is called to print a
list of recently added pages in the library.

course/lib.php

index 04b482395f8428e7c253cd4b7e6e9c92ff7b62a6..4aecfaaff1f980c1dadf4be443535f4e14f9311c 100644 (file)
@@ -210,7 +210,7 @@ function print_recent_activity($course) {
     // This function trawls through the logs looking for 
     // anything new since the user's last login
 
-    global $CFG, $USER;
+    global $CFG, $USER, $THEME, $SESSION;
 
     if (! $USER->lastlogin ) {
         echo "<p align=center><font size=1>";
@@ -304,6 +304,17 @@ function print_recent_activity($course) {
                 echo "<p><font size=1>".$change["text"]."</font></p>";
             }
         }
+    }    
+
+
+    // If this site uses Library module, then print recent items
+    if (!empty($CFG->librarypath)) {
+        if (file_exists("$CFG->dirroot/$CFG->librarypath/librarylib.php")) {
+            include_once("$CFG->dirroot/$CFG->librarypath/librarylib.php");
+            if (librarysummarize(5, '', date('YmdHis',$USER->lastlogin))) {
+                $content = true;
+            }
+        }
     }
 
     // Now display new things from each module