";
echo " ";
// Layout the left column
// Print all the course links on the side
// Then all the links to module types
$moddata = array();
$modicon = array();
if ($modtype) {
foreach ($modtype as $modname => $modfullname) {
$moddata[] = "id\">".$modfullname."s";
$modicon[] = " ";
}
}
$moddata[]="id\">Participants";
$modicon[]=" ";
$moddata[]="id&course=$course->id\">Edit my info";
$modicon[]=" ";
print_side_block("Activities", $moddata, "", $modicon);
// Admin links and controls
if ($USER->teacher[$course->id] || isadmin()) {
$adminicon[]=" ";
if ($USER->editing) {
$admindata[]="id&edit=off\">Turn editing off";
} else {
$admindata[]="id&edit=on\">Turn editing on";
}
$admindata[]="id\">Course settings...";
$adminicon[]=" ";
$admindata[]="id\">Logs...";
$adminicon[]=" ";
$admindata[]="id\">Files...";
$adminicon[]=" ";
print_side_block("Administration", $admindata, "", $adminicon);
}
// Start main column
echo " | ";
echo "| ";
echo "  ";
echo "Weekly Outline\n";
echo "";
echo "
| ";
// Now all the weekly modules
$timenow = time();
$weekdate = $course->startdate; // this should be 0:00 Monday of that week
$week = 1;
$weekofseconds = 604800;
echo "";
while ($weekdate < $course->enddate) {
echo "";
$nextweekdate = $weekdate + ($weekofseconds);
$thisweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
$weekday = date("j F", $weekdate);
$endweekday = date("j F", $weekdate+(6*24*3600));
if ($thisweek) {
$highlightcolor = $THEME->cellheading2;
} else {
$highlightcolor = $THEME->cellheading;
}
echo "| ";
echo " $week ";
echo " | ";
echo "cellcontent\">";
echo " cellheading2\">$weekday - $endweekday ";
if (! $thisweek = $weeks[$week]) {
$thisweek->course = $course->id; // Create a new week structure
$thisweek->week = $week;
$thisweek->summary = "";
$thisweek->id = insert_record("course_weeks", $thisweek);
}
if ($USER->editing) {
$thisweek->summary .= " id> ";
}
echo text_to_html($thisweek->summary);
echo "";
if ($thisweek->sequence) {
$thisweekmods = explode(",", $thisweek->sequence);
foreach ($thisweekmods as $modnumber) {
$mod = $mods[$modnumber];
$instancename = get_field("$mod->modname", "name", "id", "$mod->instance");
echo " modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\"> modname/view.php?id=$mod->id\">$instancename";
if ($USER->editing) {
echo make_editing_buttons($mod->id);
}
echo " \n";
}
}
echo " \n";
if ($USER->editing) {
echo "";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&week=$week&add=",
$modtypes, "week$week", "", "Add...");
echo " ";
}
echo " | ";
echo " | ";
echo " ";
echo " | ";
$week++;
$weekdate = $nextweekdate;
}
echo " ";
echo " | ";
// Print What's New
print_side_block("id\">What's New!",
"", "...since your last login");
// Then, print all the news items.
include("../mod/discuss/lib.php");
if ($news = get_course_news_forum($course->id)) {
echo " Latest News ";
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3);
echo "";
forum_latest_topics($news->id, 5, "minimal", "DESC", false);
echo "";
print_simple_box_end();
}
echo " |