dirroot/mod/forum/lib.php"); 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"); } } 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); /// Links to all activity modules 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); /// Start main column echo "
"; print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock"); print_spacer(8, 1, true); echo ""; /// Print Section 0 $topic = 0; $thistopic = $sections[$topic]; if ($thistopic->summary or $thistopic->sequence or isediting($course->id)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } /// Now all the normal modules by topic /// Everything below uses "section" terminology - each "section" is a topic. $timenow = time(); $section = 1; while ($section <= $course->numsections) { if (isset($USER->topic)) { // Just display a single topic if ($USER->topic != $section) { $section++; continue; } } $currenttopic = ($course->marker == $section); if ($currenttopic) { $colorsides = "bgcolor=\"$THEME->cellheading2\" class=\"topicsoutlinesidehighlight\""; $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontenthighlight\""; } else { $colorsides = "bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\""; $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $section++; } echo "
cellheading\" class=\"topicsoutlineside\" VALIGN=top WIDTH=20> cellcontent\" class=\"topicsoutlinecontent\" WIDTH=\"100%\">"; if (isediting($course->id)) { $thistopic->summary .= " id\">\"$streditsummary\"

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

$section

"; echo "
"; if (!empty($sections[$section])) { $thissection = $sections[$section]; } else { $thissection->course = $course->id; // Create a new section structure $thissection->section = $section; $thissection->summary = ""; if (!$thissection->id = insert_record("course_sections", $thissection)) { notify("Error inserting new topic!"); } } if (isediting($course->id)) { $thissection->summary .= " id>\"$streditsummary\""; } 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&section=$section&add=", $modnames, "section$section", "", "$stradd...", "mods", $stractivities); echo "
"; } echo "
"; echo ""; if (isset($USER->topic)) { $strshowalltopics = get_string("showalltopics"); echo "id&topic=all\" TITLE=\"$strshowalltopics\">

"; } else { $strshowonlytopic = get_string("showonlytopic", "", $section); echo "id&topic=$section\" TITLE=\"$strshowonlytopic\">

"; } if (isediting($course->id) and $course->marker != $section) { $strmarkthistopic = get_string("markthistopic"); echo "id&marker=$section\" TITLE=\"$strmarkthistopic\">

"; } 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"; ?>