Some changes to accomodate changes in the reading lib
[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) {
35 echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$course->id&week=0&add=reading\">Add Reading</A>...</P>";
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
55 <BR>
56
57 <? include("mod/discuss/lib.php");
58 forum_latest_topics();
59 ?>
60
61 </TD>
62 <TD WIDTH="30%" VALIGN="TOP">
63 <? print_simple_box($site->summary, $align="", $width="100%", $color="$THEME->cellheading"); ?>
64 </TD>
65 </TR>
66</TABLE>
67
3054741a 68<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
f9903ed0 69
70<P ALIGN=center>
71<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
72</P>
73