1e6b3cd02b9c80babbde1d0b435742c56e02a7d8
[moodle.git] / course / new.php
1 <?PHP // $Id$
3 // This script prints all the new things that have happened since the last login
4 // To do this, it calls new.php in each module.  It relies on $USER->lastlogin
6     require("../config.php");
7     require("lib.php");
9     require_variable($id);    // Course ID
11     if (! $course = get_record("course", "id", $id)) {
12         error("Could not find the course!");
13     }
15     require_login($course->id);
17     add_to_log("View Whats New", $course->id);
19     print_header("$course->shortname: What's new", "$course->fullname",
20                  "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> -> What's new");
22     print_heading("Recent activity since your last login"); 
23     print_heading(logdate($USER->lastlogin)); 
24     
25     print_simple_box_start("center");
26     $modules = array ("users");
28     $mods = get_records_sql("SELECT * FROM modules");
30     foreach ($mods as $mod) {
31         $modules[] = "mod/$mod->name";
32     }
34     foreach ($modules as $module) {
35         $newfile = "$CFG->dirroot/$module/new.php";
36         if (file_exists($newfile)) {
37             include($newfile);
38         }
39     }
41     print_simple_box_end();
42     print_footer($course);
44 ?>