From 670fddf1760edf5ef87f0c8a294d7ca47afcb4e1 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 26 Aug 2002 20:38:56 +0000 Subject: [PATCH] Fix for front page case when no left column --- course/lib.php | 2 +- index.php | 151 +++++++++++++++++++++++++------------------------ 2 files changed, 79 insertions(+), 74 deletions(-) diff --git a/course/lib.php b/course/lib.php index 2e80726ff8ffd..f8578cf5a47cd 100644 --- a/course/lib.php +++ b/course/lib.php @@ -504,7 +504,7 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL, $wid echo "
\n\n"; } -function print_admin_links ($siteid, $width=190) { +function print_admin_links ($siteid, $width=180) { global $THEME, $CFG; print_simple_box(get_string("administration"), $align="CENTER", $width, $color="$THEME->cellheading"); diff --git a/index.php b/index.php index ce0ad0fe8acaf..b57fecaf0e793 100644 --- a/index.php +++ b/index.php @@ -26,95 +26,100 @@ "summary))."\">", true, $headerbutton); - $side = 180; - ?> - "; + echo " - - "; + echo ""; + ?> - -
VALIGN="TOP" NOWRAP> - id); - - if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) { - - 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); - } + id); + + if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) { + + echo ""; $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 (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", "100%", "$THEME->cellheading"); - print_all_courses($cat=1, "minimal", 10); - } - print_spacer(1,$side); + if ($site->newsitems > 0 ) { + print_simple_box(get_string("courses"), "CENTER", "100%", "$THEME->cellheading"); + print_all_courses($cat=1, "minimal", 10); + } + print_spacer(1,$side); + } + + if (isadmin()) { + if (!$firstcolumn) { + echo "
"; $firstcolumn=true; } - - if (isadmin()) { - print_admin_links($site->id); + print_admin_links($site->id, $side); + } + + if ($firstcolumn) { + echo ""; + } else { + 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"); } - ?> - - - 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 = " - -
".get_string("sitenews")." - id\">$subtext -
"; + 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 { - $headertext = get_string("sitenews"); + $subtext = get_string("subscribe", "forum"); } - print_simple_box($headertext, "CENTER", "100%", $THEME->cellheading); - print_spacer(8,1); - forum_print_latest_discussions($newsforum->id, $site->newsitems); + $headertext = " + +
".get_string("sitenews")." + id\">$subtext +
"; + } else { + $headertext = get_string("sitenews"); } - ?> + print_simple_box($headertext, "CENTER", "100%", $THEME->cellheading); + print_spacer(8,1); + forum_print_latest_discussions($newsforum->id, $site->newsitems); + } + + echo "
"; + + if (isediting($site->id)) { + $site->summary .= "
"; + } + + print_simple_box($site->summary, "", "100%", $THEME->cellheading); + print_spacer(1,$side); + echo "
- id)) { - $site->summary .= "
"; - } - print_simple_box($site->summary, "", "100%", $THEME->cellheading); - print_spacer(1,$side); - ?> -