Added popup links for IP addresses in logs (display IP location on world map)
[moodle.git] / course / social.php
blob3d2a5a97541edaee6e7855a06caea443ce39fe0c
1 <? // $Id$
2 // social.php - course format featuring social forum
3 // included from view.php
5 include("../mod/forum/lib.php");
6 include("../mod/reading/lib.php");
7 ?>
9 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
10 <TR>
11 <TD WIDTH="15%" VALIGN="TOP">
12 <?
13 print_simple_box(get_string("people"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
14 $moddata[]="<A HREF=\"../user/index.php?id=$course->id\">".get_string("listofallpeople")."</A>";
15 $modicon[]="<IMG SRC=\"../user/users.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
16 $editmyprofile = "<A HREF=\"../user/view.php?id=$USER->id&course=$course->id\">".
17 get_string("editmyprofile")."</A>";
18 if ($USER->description) {
19 $moddata[]= $editmyprofile;
20 } else {
21 $moddata[]= $editmyprofile.$blinker;
23 $modicon[]="<IMG SRC=\"../user/user.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
24 print_side_block("", $moddata, "", $modicon);
28 // Then, print all the available resources (Section 0)
29 print_simple_box(get_string("resources"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
30 print_section($site->id, $sections[0], $mods, $modnamesused, true);
32 if (isediting($site->id)) {
33 echo "<DIV ALIGN=right>";
34 popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=0&add=",
35 $modnames, "section0", "", get_string("add")."...");
36 echo "</DIV>";
39 // Print all the recent activity
40 print_simple_box(get_string("recentactivity"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
41 echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
42 print_recent_activity($course);
43 echo "</TD></TR></TABLE>";
44 echo "<BR>";
46 // Print a form to search forums
47 print_simple_box(get_string("search","forum"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
48 echo "<DIV ALIGN=CENTER>";
49 forum_print_search_form($course);
50 echo "</DIV>";
52 // Admin links and controls
53 if (isteacher($course->id)) {
54 print_course_admin_links($course->id);
57 echo "</TD>";
59 echo "<TD WIDTH=\"55%\" VALIGN=\"TOP\">";
60 if ($social = forum_get_course_forum($course->id, "social")) {
61 if (forum_is_subscribed($USER->id, $social->id)) {
62 $subtext = get_string("unsubscribe", "forum");
63 } else {
64 $subtext = get_string("subscribe", "forum");
66 $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>";
67 print_simple_box("$headertext", $align="CENTER", $width="100%", $color="$THEME->cellheading");
68 echo "<IMG ALT=\"\" HEIGHT=7 SRC=\"../pix/spacer.gif\"><BR>";
70 forum_print_latest_discussions($social->id, 10, "plain", "DESC", false);
71 $SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
72 save_session("SESSION");
74 } else {
75 notify("Could not find or create a social forum here");
78 </TD>
79 </TR>
80 </TABLE>