wwwroot/$CFG->admin/index.php");
}
if ($CFG->forcelogin) {
require_login();
}
if (isadmin()) {
if (moodle_needs_upgrading()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
}
if (empty($USER->id)) {
$loginstring = "wwwroot/login/index.php\">".get_string("login")."";
} else {
$loginstring = "".user_login_string($site)."";
}
if (empty($CFG->langmenu)) {
$langmenu = "";
} else {
$currlang = current_language();
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
print_header(strip_tags($site->fullname), "$site->fullname", "home", "",
"summary))."\">",
true, "", "$loginstring$langmenu");
$firstcolumn = false; // for now
$lastcolumn = false; // for now
$side = 175;
$site_summary_editbuttons = '';
if (isediting($site->id)) {
$site_summary_editbuttons = "
";
$firstcolumn=true;
if ($sections[0]->sequence or isediting($site->id)) {
get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_section_block(get_string("mainmenu"), $site, $sections[0],
$mods, $modnames, $modnamesused, true, $side);
}
if (isadmin()) {
echo " ".update_course_icon($site->id)." ";
echo ""; } switch ($CFG->frontpage) { case FRONTPAGENEWS: // print news links on the side print_courses_sideblock(0, "$side"); break; case FRONTPAGECOURSELIST: case FRONTPAGECATEGORYNAMES: if ($site->newsitems) { if ($news = forum_get_course_forum($site->id, "news")) { print_side_block_start(get_string("latestnews"), $side, "sideblocklatestnews"); echo ""; forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false); echo ""; print_side_block_end(); } } break; } print_spacer(1,$side); } if (iscreator()) { if (!$firstcolumn) { echo " | "; $firstcolumn=true; } print_admin_links($site->id, $side); } if ($firstcolumn) { echo " | "; } if ($lastcolumn) { echo ""; } else { echo " | ";
}
switch ($CFG->frontpage) { /// Display the main part of the front page.
case FRONTPAGENEWS:
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";
if (forum_is_subscribed($USER->id, $newsforum->id)) {
$subtext = get_string("unsubscribe", "forum");
} else {
$subtext = get_string("subscribe", "forum");
}
$headertext = "
| ";
if ($lastcolumn) {
echo ""; print_simple_box(format_text($site->summary, FORMAT_HTML).$site_summary_editbuttons, "", "100%", $THEME->cellcontent2, 5, "siteinfo"); print_spacer(1,$side); echo " | "; } ?>