Layout tweak
[moodle.git] / index.php
1 <?  // $Id$
2     // index.php - the front page.
3     
4     require("config.php");
5     include("mod/reading/lib.php"); 
7     if (! $site = get_record("course", "category", 0)) {
8         redirect("$CFG->wwwroot/admin/");
9     }
11     print_header("$site->fullname", "$site->fullname", "", "",
12                  "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">");
15 ?>
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"); ?>
23           <LI>Home</LI>
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>
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=$site->id&week=0&add=reading\">Add Reading</A>...</P>";
36          }
37       ?>
39         <BR><BR>
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          }
48       ?>
50     </TD>
52     <TD WIDTH="55%" VALIGN="TOP">
53       <? print_simple_box("Site News", $align="CENTER", $width="100%", $color="$THEME->cellheading"); ?>
55       <IMG HEIGHT=8 SRC="pix/spacer.gif" ALT=""><BR>
57       <? include("mod/discuss/lib.php");
58          forum_latest_topics();
59       ?>
60     
61     </TD>
62     <TD WIDTH="30%" VALIGN="TOP"> 
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       ?>
69     </TD>
70   </TR>
71 </TABLE>
73 <? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
75 <P ALIGN=center>
76 <A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
77 </P>