Release of 1.0.7
[moodle.git] / course / social.php
blobb7cb0ebdae3c69f28693af2e6736395205f855e8
1 <? // $Id$
2 // social.php - course format featuring social forum
3 // included from view.php
5 include_once("$CFG->dirroot/mod/forum/lib.php");
6 include_once("$CFG->dirroot/mod/resource/lib.php");
8 $leftwidth = 210;
9 ?>
11 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
12 <TR>
13 <TD WIDTH="<?=$leftwidth?>" VALIGN="TOP">
14 <?
15 $moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
16 $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
17 $editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
18 get_string("editmyprofile")."</A>";
19 if ($USER->description) {
20 $moddata[]= $editmyprofile;
21 } else {
22 $moddata[]= $editmyprofile." <BLINK>*</BLINK>";
24 $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
25 print_side_block(get_string("people"), "", $moddata, $modicon, "", $leftwidth);
29 /// Then, print all the available resources (Section 0)
30 print_section_block(get_string("activities"), $course, $sections[0],
31 $mods, $modnames, $modnamesused, true, "100%", isediting($course->id));
34 /// Print all the recent activity
35 // Print all the recent activity
36 if ($course->showrecent) {
37 print_side_block_start(get_string("recentactivity"), $leftwidth, "sideblockrecentactivity");
38 print_recent_activity($course);
39 print_side_block_end();
43 /// Print a form to search forums
44 $searchform = forum_print_search_form($course, "", true);
45 $searchform = "<DIV ALIGN=\"CENTER\">$searchform</DIV>";
46 print_side_block(get_string("search","forum"), $searchform, "", "", "", $leftwidth);
48 /// Admin links and controls
49 if (isteacher($course->id)) {
50 print_course_admin_links($course, "100%", $leftwidth);
53 echo "</TD>";
55 echo "<TD WIDTH=\"*\" VALIGN=\"TOP\">";
56 if ($social = forum_get_course_forum($course->id, "social")) {
57 if (forum_is_subscribed($USER->id, $social->id)) {
58 $subtext = get_string("unsubscribe", "forum");
59 } else {
60 $subtext = get_string("subscribe", "forum");
62 $headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR><TD>".get_string("socialheadline")."</TD><TD ALIGN=RIGHT><FONT SIZE=1><A HREF=\"../mod/forum/subscribe.php?id=$social->id\">$subtext</A></TD></TR></TABLE>";
63 print_heading_block($headertext);
64 echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
66 forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
68 } else {
69 notify("Could not find or create a social forum here");
72 </TD>
73 </TR>
74 </TABLE>