2001-11-22 06:23:56 +00:00
|
|
|
<? // $Id$
|
|
|
|
// index.php - the front page.
|
|
|
|
|
|
|
|
require("config.php");
|
2002-06-16 09:44:22 +00:00
|
|
|
include("course/lib.php");
|
2002-02-26 06:35:18 +00:00
|
|
|
include("mod/reading/lib.php");
|
2002-06-20 15:15:22 +00:00
|
|
|
include("mod/forum/lib.php");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-07-11 05:30:57 +00:00
|
|
|
if (! $site = get_site()) {
|
2001-11-22 06:23:56 +00:00
|
|
|
redirect("$CFG->wwwroot/admin/");
|
|
|
|
}
|
|
|
|
|
2002-06-21 15:55:37 +00:00
|
|
|
if (isset($USER->id)) {
|
2002-06-16 03:25:10 +00:00
|
|
|
$headerbutton = update_course_icon($site->id);
|
|
|
|
} else {
|
2002-07-02 07:09:26 +00:00
|
|
|
$headerbutton = "<FONT SIZE=2><A HREF=\"login/\">".get_string("login")."</A></FONT>";
|
2002-06-16 03:25:10 +00:00
|
|
|
}
|
2001-12-10 11:10:33 +00:00
|
|
|
print_header("$site->fullname", "$site->fullname", "", "",
|
2002-06-10 05:41:36 +00:00
|
|
|
"<META NAME=\"Description\" CONTENT=\"".stripslashes(strip_tags($site->summary))."\">",
|
2002-06-16 03:25:10 +00:00
|
|
|
true, $headerbutton);
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2001-11-25 15:45:35 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|
|
|
|
|
2001-11-25 15:45:35 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
|
|
|
|
<TR>
|
2002-08-03 08:37:13 +00:00
|
|
|
<TD VALIGN="TOP" NOWRAP>
|
2002-08-03 08:16:31 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
$sections = get_all_sections($site->id);
|
2002-06-10 13:35:19 +00:00
|
|
|
|
2002-08-03 08:16:31 +00:00
|
|
|
if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) {
|
2002-08-03 08:37:13 +00:00
|
|
|
echo "<IMG SRC=\"pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
|
2002-06-10 13:35:19 +00:00
|
|
|
|
2002-06-25 11:49:06 +00:00
|
|
|
if ($site->newsitems > 0 ) {
|
2002-08-03 08:16:31 +00:00
|
|
|
print_simple_box(get_string("courses"), "CENTER", "100%", "$THEME->cellheading");
|
|
|
|
|
|
|
|
print_all_courses($cat=1, "minimal", 10);
|
2002-06-10 13:35:19 +00:00
|
|
|
}
|
|
|
|
|
2002-08-03 08:16:31 +00:00
|
|
|
if ($sections[0]->sequence or isediting($site->id)) {
|
|
|
|
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
|
|
|
|
print_simple_box(get_string("mainmenu"), "CENTER", "100%", "$THEME->cellheading");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($sections[0]->sequence) {
|
|
|
|
print_section($site->id, $sections[0], $mods, $modnamesused, true);
|
2002-02-26 06:35:18 +00:00
|
|
|
}
|
2002-08-03 08:16:31 +00:00
|
|
|
|
2002-07-29 15:45:46 +00:00
|
|
|
if (isediting($site->id)) {
|
2002-08-03 08:16:31 +00:00
|
|
|
echo "<DIV ALIGN=right>";
|
|
|
|
popup_form("$CFG->wwwroot/course/mod.php?id=$site->id§ion=0&add=",
|
|
|
|
$modnames, "section0", "", "Add...");
|
|
|
|
echo "</DIV>";
|
2002-06-11 07:43:54 +00:00
|
|
|
}
|
2002-02-26 06:35:18 +00:00
|
|
|
}
|
|
|
|
|
2001-12-11 04:30:58 +00:00
|
|
|
if (isadmin()) {
|
2002-08-03 08:16:31 +00:00
|
|
|
print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
|
|
|
$icon = "<IMG SRC=\"pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
|
|
|
$moddata[]="<A HREF=\"course/log.php?id=$site->id\">".get_string("sitelogs")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
$moddata[]="<A HREF=\"admin/site.php\">".get_string("sitesettings")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
$moddata[]="<A HREF=\"course/edit.php\">".get_string("addnewcourse")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
$moddata[]="<A HREF=\"course/teacher.php\">".get_string("assignteachers")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
$moddata[]="<A HREF=\"course/delete.php\">".get_string("deletecourse")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
$moddata[]="<A HREF=\"admin/user.php\">".get_string("edituser")."</A>";
|
|
|
|
$modicon[]=$icon;
|
|
|
|
print_side_block("", $moddata, "", $modicon);
|
2001-12-11 04:30:58 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
</TD>
|
|
|
|
|
2002-08-03 08:38:06 +00:00
|
|
|
<TD WIDTH="70%" VALIGN="TOP">
|
2002-06-25 11:49:06 +00:00
|
|
|
<? if ($site->newsitems == 0 ) {
|
2002-07-02 07:09:26 +00:00
|
|
|
print_simple_box(get_string("availablecourses"), "CENTER", "100%", "$THEME->cellheading");
|
2002-06-10 05:19:03 +00:00
|
|
|
echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
|
|
|
|
print_all_courses();
|
|
|
|
|
|
|
|
} else {
|
2002-08-01 03:50:27 +00:00
|
|
|
if (! $newsforum = forum_get_course_forum($site->id, "news")) {
|
|
|
|
error("Could not find or create a main news forum for the site");
|
2002-06-16 09:44:22 +00:00
|
|
|
}
|
|
|
|
|
2002-06-21 15:55:37 +00:00
|
|
|
if (isset($USER->id)) {
|
2002-07-31 14:19:35 +00:00
|
|
|
$SESSION->fromdiscussion = "$CFG->wwwroot";
|
2002-08-01 05:55:23 +00:00
|
|
|
if (forum_is_subscribed($USER->id, $newsforum->id)) {
|
2002-07-02 07:09:26 +00:00
|
|
|
$subtext = get_string("unsubscribe", "forum");
|
2002-06-16 09:44:22 +00:00
|
|
|
} else {
|
2002-07-02 07:09:26 +00:00
|
|
|
$subtext = get_string("subscribe", "forum");
|
2002-06-16 09:44:22 +00:00
|
|
|
}
|
|
|
|
$headertext = "<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR>
|
2002-07-02 07:09:26 +00:00
|
|
|
<TD>".get_string("sitenews")."</TD>
|
2002-06-16 09:44:22 +00:00
|
|
|
<TD ALIGN=RIGHT><FONT SIZE=1>
|
2002-06-20 15:24:59 +00:00
|
|
|
<A HREF=\"mod/forum/subscribe.php?id=$newsforum->id\">$subtext</A>
|
2002-06-16 09:44:22 +00:00
|
|
|
</TD></TR></TABLE>";
|
|
|
|
} else {
|
2002-07-02 07:09:26 +00:00
|
|
|
$headertext = get_string("sitenews");
|
2002-06-16 09:44:22 +00:00
|
|
|
}
|
2002-07-02 07:09:26 +00:00
|
|
|
print_simple_box($headertext, "CENTER", "100%", $THEME->cellheading);
|
2002-06-10 05:19:03 +00:00
|
|
|
echo "<IMG HEIGHT=8 SRC=\"pix/spacer.gif\" ALT=\"\"><BR>";
|
2002-08-01 03:50:27 +00:00
|
|
|
forum_print_latest_discussions($newsforum->id, $site->newsitems);
|
2002-06-10 05:19:03 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
?>
|
2002-06-10 05:19:03 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
</TD>
|
2002-08-03 08:38:06 +00:00
|
|
|
<TD WIDTH="30%" VALIGN="TOP">
|
2002-02-26 13:40:11 +00:00
|
|
|
<?
|
2002-07-29 15:45:46 +00:00
|
|
|
if (isediting($site->id)) {
|
2002-02-26 13:40:11 +00:00
|
|
|
$site->summary .= "<BR><CENTER><A HREF=\"admin/site.php\"><IMG SRC=\"pix/i/edit.gif\" BORDER=0></A>";
|
|
|
|
}
|
2002-07-02 07:09:26 +00:00
|
|
|
print_simple_box($site->summary, "", "100%", $THEME->cellheading);
|
2002-02-26 13:40:11 +00:00
|
|
|
?>
|
2001-11-22 06:23:56 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
</TABLE>
|
|
|
|
|
2001-11-25 15:45:35 +00:00
|
|
|
<? include("$CFG->dirroot/theme/$CFG->theme/footer.html"); ?>
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
<P ALIGN=center>
|
|
|
|
<A WIDTH=85 HEIGHT=25 HREF="http://moodle.com/"><IMG SRC="pix/madewithmoodle.gif" BORDER=0></A>
|
|
|
|
</P>
|
|
|
|
|