2002-02-26 06:33:48 +00:00
|
|
|
<? // $Id$
|
|
|
|
// social.php - course format featuring social forum
|
|
|
|
// included from view.php
|
|
|
|
|
2002-06-20 15:15:22 +00:00
|
|
|
include("../mod/forum/lib.php");
|
2002-02-26 06:33:48 +00:00
|
|
|
include("../mod/reading/lib.php");
|
|
|
|
?>
|
|
|
|
|
|
|
|
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
|
|
|
|
<TR>
|
|
|
|
<TD WIDTH="15%" VALIGN="TOP">
|
|
|
|
<?
|
2002-08-11 15:41:54 +00:00
|
|
|
print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
2002-09-08 05:29:00 +00:00
|
|
|
$moddata[]="<A TITLE=\"".get_string("listofallpeople")."\" HREF=\"../user/index.php?id=$course->id\">".get_string("participants")."</A>";
|
2002-08-11 15:41:54 +00:00
|
|
|
$modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
2002-09-08 09:41:17 +00:00
|
|
|
$editmyprofile = "<A TITLE=\"$USER->firstname $USER->lastname\" HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
|
2002-08-11 15:41:54 +00:00
|
|
|
get_string("editmyprofile")."</A>";
|
|
|
|
if ($USER->description) {
|
|
|
|
$moddata[]= $editmyprofile;
|
|
|
|
} else {
|
|
|
|
$moddata[]= $editmyprofile.$blinker;
|
|
|
|
}
|
|
|
|
$modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
2002-02-26 06:33:48 +00:00
|
|
|
print_side_block("", $moddata, "", $modicon);
|
2002-08-11 15:41:54 +00:00
|
|
|
|
2002-02-26 06:33:48 +00:00
|
|
|
|
|
|
|
|
2002-08-03 11:58:40 +00:00
|
|
|
// Then, print all the available resources (Section 0)
|
2002-08-11 15:41:54 +00:00
|
|
|
print_simple_box(get_string("resources"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
2002-08-03 11:58:40 +00:00
|
|
|
print_section($site->id, $sections[0], $mods, $modnamesused, true);
|
|
|
|
|
|
|
|
if (isediting($site->id)) {
|
|
|
|
echo "<DIV ALIGN=right>";
|
|
|
|
popup_form("$CFG->wwwroot/course/mod.php?id=$course->id§ion=0&add=",
|
2002-08-11 15:41:54 +00:00
|
|
|
$modnames, "section0", "", get_string("add")."...");
|
2002-08-03 11:58:40 +00:00
|
|
|
echo "</DIV>";
|
|
|
|
}
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2002-05-31 09:34:50 +00:00
|
|
|
// Print all the recent activity
|
2002-08-11 15:41:54 +00:00
|
|
|
print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
2002-05-31 09:34:50 +00:00
|
|
|
echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
|
|
|
print_recent_activity($course);
|
|
|
|
echo "</TD></TR></TABLE>";
|
2002-06-01 09:48:24 +00:00
|
|
|
echo "<BR>";
|
2002-05-31 09:34:50 +00:00
|
|
|
|
2002-07-31 14:19:35 +00:00
|
|
|
// Print a form to search forums
|
2002-08-06 09:24:40 +00:00
|
|
|
print_simple_box(get_string("search","forum"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
2002-06-11 04:56:11 +00:00
|
|
|
echo "<DIV ALIGN=CENTER>";
|
2002-08-02 09:50:53 +00:00
|
|
|
forum_print_search_form($course);
|
2002-06-11 04:56:11 +00:00
|
|
|
echo "</DIV>";
|
|
|
|
|
2002-08-18 16:16:24 +00:00
|
|
|
// Admin links and controls
|
2002-08-11 15:41:54 +00:00
|
|
|
if (isteacher($course->id)) {
|
2002-09-08 03:24:38 +00:00
|
|
|
print_course_admin_links($course);
|
2002-02-26 06:33:48 +00:00
|
|
|
}
|
|
|
|
|
2002-08-01 03:50:27 +00:00
|
|
|
echo "</TD>";
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2002-08-01 03:50:27 +00:00
|
|
|
echo "<TD WIDTH=\"55%\" VALIGN=\"TOP\">";
|
|
|
|
if ($social = forum_get_course_forum($course->id, "social")) {
|
|
|
|
if (forum_is_subscribed($USER->id, $social->id)) {
|
2002-08-11 15:41:54 +00:00
|
|
|
$subtext = get_string("unsubscribe", "forum");
|
2002-08-01 03:50:27 +00:00
|
|
|
} else {
|
2002-08-11 15:41:54 +00:00
|
|
|
$subtext = get_string("subscribe", "forum");
|
2002-08-01 03:50:27 +00:00
|
|
|
}
|
2002-08-11 15:41:54 +00:00
|
|
|
$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>";
|
2002-08-01 03:50:27 +00:00
|
|
|
print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
|
|
|
echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
|
|
|
|
|
|
|
|
forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
|
|
|
|
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
|
2002-08-06 17:23:45 +00:00
|
|
|
save_session("SESSION");
|
2002-02-26 06:33:48 +00:00
|
|
|
|
|
|
|
} else {
|
2002-08-01 03:50:27 +00:00
|
|
|
notify("Could not find or create a social forum here");
|
2002-02-26 06:33:48 +00:00
|
|
|
}
|
|
|
|
?>
|
2002-08-01 03:50:27 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
2002-02-26 06:33:48 +00:00
|
|
|
</TABLE>
|
|
|
|
|