index.php 2.91 KB
Newer Older
martin's avatar
martin committed
1
2
3
4
<?  // $Id$
    // index.php - the front page.
    
    require("config.php");
5
    include("mod/reading/lib.php"); 
martin's avatar
martin committed
6
7
8
9
10

    if (! $site = get_record("course", "category", 0)) {
        redirect("$CFG->wwwroot/admin/");
    }

11
    print_header("$site->fullname", "$site->fullname", "", "",
martin's avatar
martin committed
12
13
                 "<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
                 true, update_course_icon($site->id));
martin's avatar
martin committed
14

15

martin's avatar
martin committed
16
17
?>

18

martin's avatar
martin committed
19
20
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
  <TR>
martin's avatar
martin committed
21
    <TD VALIGN="TOP" NOWRAP>
22
23
24
25
26
27
28
29
30
31
32
33
34
35
      <? $readings = list_all_readings();
      
         if ($site->format > 0 or $readings or $USER->editing) {
      
             print_simple_box("Main Menu", $align="CENTER", $width="100%", $color="$THEME->cellheading");

             if ($site->format > 0 ) {
                 echo "<LI><A TITLE=\"Available courses on this server\" HREF=\"course/\"><B>Courses</B></A><BR></LI>";
             } 

             if ($readings) {
                 foreach ($readings as $reading) {
	             echo "<LI>$reading";
                 }
36
             }
martin's avatar
martin committed
37
38
39
40
41
             if ($USER->editing) {
                 echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&week=0&add=reading\">Add Reading</A>...</P>";
             } else {
                 echo "<BR><BR>";
             }
42
43
         }
     
44
45
46

         if (isadmin()) {
             print_simple_box("Admin", $align="CENTER", $width="100%", $color="$THEME->cellheading");
martin's avatar
martin committed
47
             echo "<LI><A HREF=\"$CFG->wwwroot/admin/\">Admin Page...</A></LI>";
martin's avatar
martin committed
48
             echo "<LI><A HREF=\"$CFG->wwwroot/course/log.php?id=$site->id\">Site logs...</A></LI>";
martin's avatar
martin committed
49
             echo "<LI><A HREF=\"$CFG->wwwroot/admin/site.php\">Site settings...</A></LI>";
50
         }
martin's avatar
martin committed
51
52
53
54
      ?>

    </TD>

martin's avatar
martin committed
55
    <TD WIDTH="70%" VALIGN="TOP">
56
57
58
59
60
61
62
63
64
65
66
67
      <? if ($site->format == 0 ) {
             print_simple_box("Available Courses", $align="CENTER", $width="100%", $color="$THEME->cellheading");
             echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
             include("course/lib.php");
             print_all_courses();

         } else {
             print_simple_box("Site News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
             echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
             include("mod/discuss/lib.php");
             forum_latest_topics(0, $site->format);
         }
martin's avatar
martin committed
68
      ?>
69

martin's avatar
martin committed
70
71
    </TD>
    <TD WIDTH="30%" VALIGN="TOP"> 
martin's avatar
martin committed
72
73
74
75
76
77
      <? 
         if ($USER->editing) {
             $site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
         }
         print_simple_box($site->summary, $align="", $width="100%", $color="$THEME->cellheading");
      ?>
martin's avatar
martin committed
78
79
80
81
    </TD>
  </TR>
</TABLE>

82
<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
martin's avatar
martin committed
83
84
85
86
87

<P ALIGN=center>
<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
</P>