diff --git a/course/lib.php b/course/lib.php index c1191ec0160..f3375d9eccb 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4,7 +4,8 @@ $MAXNEWSDISPLAY = 4; $FORMATS = array ( "1" => "Weekly layout", - "2" => "Social layout" + "2" => "Social layout", + "3" => "Topics layout" ); diff --git a/course/topics.php b/course/topics.php new file mode 100644 index 00000000000..a8f641c1cc0 --- /dev/null +++ b/course/topics.php @@ -0,0 +1,219 @@ +id) ) { + $week->course = $course->id; // Create a default week. + $week->week = 0; + $week->id = insert_record("course_weeks", $week); + if (! $rawweeks = get_records("course_weeks", "course", $course->id) ) { + error("Error finding or creating week structures for this course"); + } + } + + foreach($rawweeks as $cw) { //Index the weeks + $weeks[$cw->week] = $cw; + } + + 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
+
+ print_simple_box("People", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ $moddata[]="id\">List of all people";
+ $modicon[]="![]() ![]() ![]() ";
+ print_discussion_search_form($course);
+ echo " ";
+
+ // Admin links and controls
+
+ if (isteacher($course->id)) {
+ $adminicon[]="![]() ![]() ![]() ![]() | ";
+
+ print_simple_box("Topic Outline", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+
+ // Everything below uses "week" terminology - each "week" is a topic.
+
+ // Now all the weekly modules
+ $timenow = time();
+ $weekdate = $course->startdate; // this should be 0:00 Monday of that week
+ $week = 1;
+ $weekofseconds = 604800;
+
+ echo "
| ";
+
+ // Print all the news items.
+
+ if ($news = get_course_news_forum($course->id)) {
+ print_simple_box("Latest News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
+ print_simple_box_start("CENTER", "100%", "#FFFFFF", 3, 0);
+ echo "";
+ forum_latest_topics($news->id, 5, "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 " |