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