// $Id$ // index.php - the front page. require("config.php"); include("course/lib.php"); include("mod/reading/lib.php"); include("mod/forum/lib.php"); if (! $site = get_site()) { redirect("$CFG->wwwroot/admin/"); } if (isadmin()) { if (moodle_needs_upgrading()) { redirect("$CFG->wwwroot/admin/"); } $headerbutton = update_course_icon($site->id); } else { if (isset($USER->id)) { $headerbutton = "wwwroot/login/logout.php\">".get_string("logout").""; } else { $headerbutton = "wwwroot/login\">".get_string("login").""; } } print_header("$site->fullname", "$site->fullname", "", "", "summary))."\">", true, $headerbutton); $side = 180; ?>
"; $firstcolumn=true;
if ($sections[0]->sequence or isediting($site->id)) {
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_simple_box(get_string("mainmenu"), "CENTER", $side, "$THEME->cellheading");
}
if ($sections[0]->sequence) {
print_section($site->id, $sections[0], $mods, $modnamesused, true, $side);
}
if (isediting($site->id)) {
echo " ";
popup_form("$CFG->wwwroot/course/mod.php?id=$site->id§ion=0&add=",
$modnames, "section0", "", "Add...");
echo " ";
}
if ($site->newsitems > 0 ) {
print_simple_box(get_string("courses"), "CENTER", $side, "$THEME->cellheading");
print_all_courses($cat=1, "minimal", 10);
}
print_spacer(1,$side);
}
if (isadmin()) {
if (!$firstcolumn) {
echo " | "; $firstcolumn=true; } print_admin_links($site->id, $side); } if ($firstcolumn) { echo " | "; } echo "";
if ($site->newsitems == 0 ) {
print_simple_box(get_string("availablecourses"), "CENTER", "100%", "$THEME->cellheading");
print_spacer(8,1);
print_all_courses();
} else {
if (! $newsforum = forum_get_course_forum($site->id, "news")) {
error("Could not find or create a main news forum for the site");
}
if (isset($USER->id)) {
$SESSION->fromdiscussion = "$CFG->wwwroot";
save_session("SESSION");
if (forum_is_subscribed($USER->id, $newsforum->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "
| ";
echo "";
if (isediting($site->id)) {
$site->summary .= " | ";
?>