dirroot/mod/forum/lib.php"); if (isset($week)) { if ($week == "all") { unset($USER->section); } else { $USER->section = $week; } save_session("USER"); } if ($course->newsitems) { $news = forum_get_course_forum($course->id, "news"); } $streditsummary = get_string("editsummary"); $stradd = get_string("add"); $stractivities = get_string("activities"); /// Layout the whole page as three big columns. echo ""; /// The left column ... echo "
"; /// Links to people $moddata[]="id\">".get_string("participants").""; $modicon[]="\"\""; $editmyprofile = "firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".get_string("editmyprofile").""; if ($USER->description) { $moddata[]= $editmyprofile; } else { $moddata[]= $editmyprofile." *"; } $modicon[]="\"\""; print_side_block(get_string("people"), "", $moddata, $modicon); /// Then all the links to activities by type $moddata = array(); $modicon = array(); if ($modnamesused) { foreach ($modnamesused as $modname => $modfullname) { $moddata[] = "id\">".$modnamesplural[$modname].""; $modicon[] = "\"\""; } } print_side_block($stractivities, "", $moddata, $modicon); /// Print a form to search forums $searchform = forum_print_search_form($course, "", true); $searchform = "
$searchform
"; print_side_block(get_string("search","forum"), $searchform); /// Admin links and controls if (isteacher($course->id)) { print_course_admin_links($course); } /// Start main column echo "
"; print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock"); print_spacer(8, 1, true); echo ""; /// Print Week 0 with general activities $week = 0; $thisweek = $sections[$week]; if ($thisweek->summary or $thisweek->sequence or isediting($course->id)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } /// Now all the weekly sections $timenow = time(); $weekdate = $course->startdate; // this should be 0:00 Monday of that week $week = 1; $weekofseconds = 604800; $course->enddate = $course->startdate + ($weekofseconds * $course->numsections); while ($weekdate < $course->enddate) { $nextweekdate = $weekdate + ($weekofseconds); if (isset($USER->section)) { // Just display a single week if ($USER->section != $week) { $week++; $weekdate = $nextweekdate; continue; } } $thisweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate)); $weekday = userdate($weekdate, " %d %B"); $endweekday = userdate($weekdate+518400, " %d %B"); if ($thisweek) { $colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"weeklyoutlinesidehighlight\""; $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthighlight\""; } else { $colorsides = "bgcolor=\"$THEME->cellheading\" class=\"weeklyoutlineside\""; $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontent\""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $week++; $weekdate = $nextweekdate; } echo "
cellheading\" class=\"weeklyoutlineside\" VALIGN=top WIDTH=20> cellcontent\" class=\"weeklyoutlinecontent\" WIDTH=\"100%\">"; if (isediting($course->id)) { $thisweek->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thisweek->summary); print_section($course, $thisweek, $mods, $modnamesused); if (isediting($course->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$week&add=", $modnames, "section$week", "", "$stradd...", "mods", $stractivities); echo "
"; } echo "
cellheading\" class=\"weeklyoutlineside\" VALIGN=top ALIGN=CENTER WIDTH=10>"; echo " 
"; echo "

$week

"; echo "
"; echo "

cellheading2\">$weekday - $endweekday

"; if (! $thisweek = $sections[$week]) { $thisweek->course = $course->id; // Create a new week structure $thisweek->section = $week; $thisweek->summary = ""; if (!$thisweek->id = insert_record("course_sections", $thisweek)) { notify("Error inserting new week!"); } } if (isediting($course->id)) { $thisweek->summary .= " id\">\"$streditsummary\"

"; } echo text_to_html($thisweek->summary); print_section($course, $thisweek, $mods, $modnamesused); if (isediting($course->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$week&add=", $modnames, "section$week", "", "$stradd...", "mods", $stractivities); echo "
"; } echo "
"; echo ""; if (isset($USER->section)) { $strshowallweeks = get_string("showallweeks"); echo "id&week=all\" TITLE=\"$strshowallweeks\">"; } else { $strshowonlyweek = get_string("showonlyweek", "", $week); echo "id&week=$week\" TITLE=\"$strshowonlyweek\">"; } echo "
"; if ($news or $course->showrecent) { echo "
"; // Print all the news items. if ($news) { print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews"); echo ""; forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false); echo ""; print_side_block_end(); } // Print all the recent activity if ($course->showrecent) { print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity"); print_recent_activity($course); print_side_block_end(); } print_spacer(1, 120, true); } echo "
\n"; ?>