id) ) { $section->course = $course->id; // Create a default section. $section->section = 0; $section->id = insert_record("course_sections", $section); if (! $sections = get_all_sections($course->id) ) { error("Error finding or creating section structures for this course"); } } if (isset($topic)) { if ($topic == "all") { unset($USER->topic); } else { $USER->topic = $topic; } } if (isteacher($course->id) and isset($marker)) { $course->marker = $marker; if (! set_field("course", "marker", $marker, "id", $course->id)) { error("Could not mark that topic for this course"); } } // Layout the whole page as three big columns. echo "
";
// Layout the left column
// Links to people
$blinker = " ";
print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
$moddata[]="id\">List of all people";
$modicon[]="";
$editmyprofile = "id&course=$course->id\">Edit my profile";
if ($USER->description) {
$moddata[]= $editmyprofile;
} else {
$moddata[]= $editmyprofile.$blinker;
}
$modicon[]="";
print_side_block("", $moddata, "", $modicon);
// Then all the links to module types
$moddata = array();
$modicon = array();
if ($modtype) {
foreach ($modtype as $modname => $modfullname) {
$moddata[] = "id\">".$modfullname."s";
$modicon[] = "";
}
}
print_simple_box("Activities", $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $moddata, "", $modicon);
// Print a form to search forums
print_simple_box("Search Discussions", $align="CENTER", $width="100%", $color="$THEME->cellheading");
echo " ";
forum_print_search_form($course);
echo " ";
// Admin links and controls
if (isteacher($course->id)) {
$adminicon[]="";
if (isediting($course->id)) {
$admindata[]="id&edit=off\">Turn editing off";
} else {
$admindata[]="id&edit=on\">Turn editing on";
}
if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
$admindata[]="id\">Teacher Forum...";
$adminicon[]="";
}
$admindata[]="id\">Course settings...";
$adminicon[]="";
$admindata[]="id\">Logs...";
$adminicon[]="";
$admindata[]="id\">Files...";
$adminicon[]="";
print_simple_box("Administration", $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_side_block("", $admindata, "", $adminicon);
}
// Start main column
echo " | ";
print_simple_box("Topic Outline", $align="CENTER", $width="100%", $color="$THEME->cellheading");
// Everything below uses "section" terminology - each "section" is a topic.
// Now all the sectionly modules
$timenow = time();
$section = 1;
echo "
| ";
// Print all the news items.
if ($news = forum_get_course_forum($course->id, "news")) {
print_simple_box("Latest News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
echo "";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "";
print_simple_box_end();
}
echo " "; // Print all the recent activity print_simple_box("Recent Activity", $align="CENTER", $width="100%", $color="$THEME->cellheading"); print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0); print_recent_activity($course); print_simple_box_end(); echo " |