Tweak: added courses link back in ... because courses page may
[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", "", "",
de973a18 12 "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
13 true, update_course_icon($site->id));
f9903ed0 14
3054741a 15
f9903ed0 16?>
17
3054741a 18
f9903ed0 19<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
20 <TR>
21 <TD WIDTH="15%" VALIGN="TOP" NOWRAP>
22 <? print_simple_box("Main Menu", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
23
24 <LI>Home</LI>
3054741a 25 <LI><A TITLE="Available courses on this server" HREF="course/"><B>Courses</B></A><BR></LI>
7a522f28 26 <? if ($site->format > 0 ) { ?>
3054741a 27 <LI><A TITLE="Site-level Forums" HREF="mod/discuss/index.php?id=<?=$site->id?>">Forums</A></LI>
d887b5a7 28 <? } ?>
f9903ed0 29
693c02d0 30 <?
31 if ($readings = list_all_readings()) {
32 foreach ($readings as $reading) {
33 echo "<LI>$reading";
34 }
35 }
36
37 if ($USER->editing) {
a5fbfa8a 38 echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&week=0&add=reading\">Add Reading</A>...</P>";
693c02d0 39 }
a166f060 40 ?>
41
42 <BR><BR>
43
44 <?
45 if (isadmin()) {
46 print_simple_box("Admin", $align="CENTER", $width="100%", $color="$THEME->cellheading");
de973a18 47 echo "<LI><A HREF=\"$CFG->wwwroot/admin/\">Admin Page...</A></LI>";
48 echo "<LI><A HREF=\"$CFG->wwwroot/admin/site.php\">Site settings...</A></LI>";
a166f060 49 }
f9903ed0 50 ?>
51
52 </TD>
53
54 <TD WIDTH="55%" VALIGN="TOP">
d887b5a7 55 <? if ($site->format == 0 ) {
56 print_simple_box("Available Courses", $align="CENTER", $width="100%", $color="$THEME->cellheading");
57 echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
58 include("course/lib.php");
59 print_all_courses();
60
61 } else {
62 print_simple_box("Site News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
63 echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
64 include("mod/discuss/lib.php");
65 forum_latest_topics(0, $site->format);
66 }
f9903ed0 67 ?>
d887b5a7 68
f9903ed0 69 </TD>
70 <TD WIDTH="30%" VALIGN="TOP">
45d1cc4a 71 <?
72 if ($USER->editing) {
73 $site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
74 }
75 print_simple_box($site->summary, $align="", $width="100%", $color="$THEME->cellheading");
76 ?>
f9903ed0 77 </TD>
78 </TR>
79</TABLE>
80
3054741a 81<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
f9903ed0 82
83<P ALIGN=center>
84<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
85</P>
86