Layout tweak
[moodle.git] / index.php
CommitLineData
f9903ed0 1<? // $Id$
2 // index.php - the front page.
3
4 require("config.php");
693c02d0 5 include("mod/reading/lib.php");
f9903ed0 6
7 if (! $site = get_record("course", "category", 0)) {
8 redirect("$CFG->wwwroot/admin/");
9 }
10
c8138d90 11 print_header("$site->fullname", "$site->fullname", "", "",
9284942d 12 "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">");
f9903ed0 13
3054741a 14
f9903ed0 15?>
16
3054741a 17
f9903ed0 18<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
19 <TR>
20 <TD WIDTH="15%" VALIGN="TOP" NOWRAP>
21 <? print_simple_box("Main Menu", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
22
23 <LI>Home</LI>
3054741a 24 <LI><A TITLE="Available courses on this server" HREF="course/"><B>Courses</B></A><BR></LI>
25 <LI><A TITLE="Site-level Forums" HREF="mod/discuss/index.php?id=<?=$site->id?>">Forums</A></LI>
f9903ed0 26
693c02d0 27 <?
28 if ($readings = list_all_readings()) {
29 foreach ($readings as $reading) {
30 echo "<LI>$reading";
31 }
32 }
33
34 if ($USER->editing) {
a5fbfa8a 35 echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&week=0&add=reading\">Add Reading</A>...</P>";
693c02d0 36 }
a166f060 37 ?>
38
39 <BR><BR>
40
41 <?
42 if (isadmin()) {
43 print_simple_box("Admin", $align="CENTER", $width="100%", $color="$THEME->cellheading");
44 echo "<LI><A HREF=\"$CFG->wwwroot/admin/\">Admin Page</A></LI>";
45 echo "<LI>";
46 print_editing_switch($site->id);
47 }
f9903ed0 48 ?>
49
50 </TD>
51
52 <TD WIDTH="55%" VALIGN="TOP">
53 <? print_simple_box("Site News", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
54
0f8a30bf 55 <IMG HEIGHT=8 SRC="pix/spacer.gif" ALT=""><BR>
f9903ed0 56
57 <? include("mod/discuss/lib.php");
58 forum_latest_topics();
59 ?>
60
61 </TD>
62 <TD WIDTH="30%" VALIGN="TOP">
45d1cc4a 63 <?
64 if ($USER->editing) {
65 $site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
66 }
67 print_simple_box($site->summary, $align="", $width="100%", $color="$THEME->cellheading");
68 ?>
f9903ed0 69 </TD>
70 </TR>
71</TABLE>
72
3054741a 73<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
f9903ed0 74
75<P ALIGN=center>
76<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
77</P>
78