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