";
/// Links to people
$moddata[]="id\">".get_string("participants")."";
$modicon[]="";
$editmyprofile = "firstname $USER->lastname\" href=\"../user/edit.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
print_course_admin_links($course);
/// My courses
print_courses_sideblock(0, "180");
/// Start main column
echo " | ";
print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
print_spacer(8, 1, true);
echo "";
/// If currently moving a file then show the current clipboard
if (ismoving($course->id)) {
$stractivityclipboard = get_string("activityclipboard", "", addslashes($USER->activitycopyname));
$strcancel= get_string("cancel");
echo "";
echo "cellcontent\" class=\"weeklyoutlineclip\" width=\"100%\">";
echo " ";
echo "$stractivityclipboard ($strcancel)";
echo " ";
echo " | ";
echo " ";
echo " | ";
}
/// Print Section 0 with general activities
$section = 0;
$thissection = $sections[$section];
if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
echo "";
echo "cellheading\" class=\"weeklyoutlineside\" valign=top width=20> | ";
echo "cellcontent\" class=\"weeklyoutlinecontent\" width=\"100%\">";
if (isediting($course->id)) {
$thissection->summary .= " id\">";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo " ";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&add=",
$modnames, "section$section", "", "$stradd...", "mods", $stractivities);
echo " ";
}
echo " | ";
echo "cellheading\" class=\"weeklyoutlineside\" valign=top align=center width=10>";
echo " | ";
echo " | ";
}
/// Now all the weekly sections
$timenow = time();
$weekdate = $course->startdate; // this should be 0:00 Monday of that week
$weekdate += 7200; // Add two hours to avoid possible DST problems
$section = 1;
$sectionmenu = array();
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
$strftimedateshort = " ".get_string("strftimedateshort");
while ($weekdate < $course->enddate) {
$nextweekdate = $weekdate + ($weekofseconds);
$weekday = userdate($weekdate, $strftimedateshort);
$endweekday = userdate($weekdate+518400, $strftimedateshort);
if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
$sectionmenu["week=$section"] = s("$strweek $section | $weekday - $endweekday");
$section++;
$weekdate = $nextweekdate;
continue;
}
if (!empty($sections[$section])) {
$thissection = $sections[$section];
} else {
unset($thissection);
$thissection->course = $course->id; // Create a new week structure
$thissection->section = $section;
$thissection->summary = "";
$thissection->visible = 1;
if (!$thissection->id = insert_record("course_sections", $thissection)) {
notify("Error inserting new week!");
}
}
$currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
if (!$thissection->visible) {
$colorsides = "bgcolor=\"$THEME->hidden\" class=\"weeklyoutlinesidehidden\"";
$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"weeklyoutlinecontenthidden\"";
} else if ($currentweek) {
$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 " $section ";
echo " | ";
echo "";
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
echo " $weekday - $endweekday ";
echo "(".get_string("notavailable").")";
echo " ";
echo " | ";
} else {
echo "$weekday - $endweekday ";
if (isediting($course->id)) {
$thissection->summary .= " id\">".
"";
}
echo text_to_html($thissection->summary);
print_section($course, $thissection, $mods, $modnamesused);
if (isediting($course->id)) {
echo "";
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=$section&add=",
$modnames, "section$section", "", "$stradd...");
echo " ";
}
echo "";
}
echo "";
echo "";
if ($displaysection == $section) {
echo "id&week=all\" title=\"$strshowallweeks\">".
" ";
} else {
$strshowonlyweek = get_string("showonlyweek", "", $section);
echo "id&week=$section\" title=\"$strshowonlyweek\">".
" ";
}
if (isediting($course->id)) {
if ($thissection->visible) { // Show the hide/show eye
echo "id&hide=$section\" title=\"$strweekhide\">".
" ";
} else {
echo "id&show=$section\" title=\"$strweekshow\">".
" ";
}
if ($section > 1) { // Add a arrow to move section up
echo "id§ion=$section&move=-1\" title=\"$strmoveup\">".
" ";
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo "id§ion=$section&move=1\" title=\"$strmovedown\">".
" ";
}
}
echo " | ";
echo " ";
echo " | ";
$section++;
$weekdate = $nextweekdate;
}
echo " ";
if (!empty($sectionmenu)) {
echo "";
echo popup_form("$CFG->wwwroot/course/view.php?id=$course->id&", $sectionmenu,
"sectionmenu", "", get_string("jumpto"), "", "", true);
echo "";
}
if (!empty($news) or !empty($course->showrecent)) {
echo " | ";
// Print all the news items.
if (!empty($news)) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false);
echo "";
print_side_block_end();
}
// Print all the recent activity
if (!empty($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 " |