From: moodler Date: Tue, 26 Aug 2003 18:45:54 +0000 (+0000) Subject: Added a hook when printing recent activity. If the Library X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bf40f9c1ef30be762d1cca94d082347ada13b68b;p=moodle.git Added a hook when printing recent activity. If the Library module is activated, then a Library function is called to print a list of recently added pages in the library. --- diff --git a/course/lib.php b/course/lib.php index 04b482395f..4aecfaaff1 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 "

"; @@ -304,6 +304,17 @@ function print_recent_activity($course) { echo "

".$change["text"]."

"; } } + } + + + // 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