id);
add_to_log($course->id, "autoattendmod", "view all", "index.php?id=$course->id", "");
/// Get all required strings
$strautoattendmods = get_string("modulenameplural", "autoattendmod");
$strautoattendmod = get_string("modulename", "autoattendmod");
/// Print the header
if ($course->category) {
$navigation = "id\">$course->shortname ->";
}
print_header("$course->shortname: $strautoattendmods", "$course->fullname",
"$navigation $strautoattendmods", "", "", true, "", navmenu($course));
/// Get all the appropriate data
if (! $autoattendmods = get_all_instances_in_course("autoattendmod", $course)) {
notice("There are no autoattendmods", "../../course/view.php?id=$course->id");
die;
}
/// Print the list of instances (your module will probably extend this)
$timenow = time();
$strname = get_string("name");
$strweek = get_string("week");
$strtopic = get_string("topic");
if ($course->format == "weeks") {
$table->head = array ($strweek, $strname);
$table->align = array ("CENTER", "LEFT");
}
else if ($course->format == "topics") {
$table->head = array ($strtopic, $strname);
$table->align = array ("CENTER", "LEFT", "LEFT", "LEFT");
}
else {
$table->head = array ($strname);
$table->align = array ("LEFT", "LEFT", "LEFT");
}
foreach ($autoattendmods as $autoattendmod) {
if (!$autoattendmod->visible) {
//Show dimmed if the mod is hidden
$link = "coursemodule\">$autoattendmod->name";
}
else {
//Show normal if the mod is visible
$link = "coursemodule\">$autoattendmod->name";
}
if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ($autoattendmod->section, $link);
} else {
$table->data[] = array ($link);
}
}
echo "
";
print_table($table);
/// Finish the page
print_footer($course);
?>