Changes to strings in print_recent_activity (added, updated, deleted activities)
[moodle.git] / index.php
blob881c48ed216a0ab281e03a7f1d9983f9b697d3df
1 <? // $Id$
2 // index.php - the front page.
4 require("config.php");
5 include("course/lib.php");
6 include("mod/reading/lib.php");
7 include("mod/forum/lib.php");
9 if (! $site = get_site()) {
10 redirect("$CFG->wwwroot/admin/");
13 if (isadmin()) {
14 if (moodle_needs_upgrading()) {
15 redirect("$CFG->wwwroot/admin/");
17 $headerbutton = update_course_icon($site->id);
18 } else if (!isset($USER->id)) {
19 $headerbutton = "<FONT SIZE=2><A HREF=\"login/\">".get_string("login")."</A></FONT>";
21 print_header("$site->fullname", "$site->fullname", "", "",
22 "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
23 true, $headerbutton);
29 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
30 <TR>
31 <TD VALIGN="TOP" NOWRAP>
32 <?
34 $sections = get_all_sections($site->id);
36 if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
38 if ($sections[0]->sequence or isediting($site->id)) {
39 get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
40 print_simple_box(get_string("mainmenu"), "CENTER", "100%", "$THEME->cellheading");
43 if ($sections[0]->sequence) {
44 print_section($site->id, $sections[0], $mods, $modnamesused, true);
47 if (isediting($site->id)) {
48 echo "<DIV ALIGN=right>";
49 popup_form("$CFG->wwwroot/course/mod.php?id=$site->id&section=0&add=",
50 $modnames, "section0", "", "Add...");
51 echo "</DIV>";
54 if ($site->newsitems > 0 ) {
55 print_simple_box(get_string("courses"), "CENTER", "100%", "$THEME->cellheading");
56 print_all_courses($cat=1, "minimal", 10);
58 echo "<IMG SRC=\"pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
61 if (isadmin()) {
62 print_admin_links($site->id);
66 </TD>
68 <TD WIDTH="70%" VALIGN="TOP">
69 <? if ($site->newsitems == 0 ) {
70 print_simple_box(get_string("availablecourses"), "CENTER", "100%", "$THEME->cellheading");
71 echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
72 print_all_courses();
74 } else {
75 if (! $newsforum = forum_get_course_forum($site->id, "news")) {
76 error("Could not find or create a main news forum for the site");
79 if (isset($USER->id)) {
80 $SESSION->fromdiscussion = "$CFG->wwwroot";
81 save_session("SESSION");
82 if (forum_is_subscribed($USER->id, $newsforum->id)) {
83 $subtext = get_string("unsubscribe", "forum");
84 } else {
85 $subtext = get_string("subscribe", "forum");
87 $headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR>
88 <TD>".get_string("sitenews")."</TD>
89 <TD ALIGN=RIGHT><FONT SIZE=1>
90 <A HREF=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</A>
91 </TD></TR></TABLE>";
92 } else {
93 $headertext = get_string("sitenews");
95 print_simple_box($headertext, "CENTER", "100%", $THEME->cellheading);
96 echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
97 forum_print_latest_discussions($newsforum->id, $site->newsitems);
101 </TD>
102 <TD WIDTH="30%" VALIGN="TOP">
104 if (isediting($site->id)) {
105 $site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
107 print_simple_box($site->summary, "", "100%", $THEME->cellheading);
109 </TD>
110 </TR>
111 </TABLE>
113 <? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
115 <P ALIGN=center>
116 <A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
117 </P>