diff --git a/course/lib.php b/course/lib.php index 2e80726ff8f..f8578cf5a47 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 ce0ad0fe8ac..b57fecaf0e7 100644 --- a/index.php +++ b/index.php @@ -26,95 +26,100 @@ "summary))."\">", true, $headerbutton); - $side = 180; - ?> - - - - + } + + if (isadmin()) { + if (!$firstcolumn) { + echo ""; + echo ""; + echo ""; + ?> +
VALIGN="TOP" NOWRAP> - id); + + if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id)) { - $sections = get_all_sections($site->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"); - } + 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 ($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 ($sections[0]->sequence) { + print_section($site->id, $sections[0], $mods, $modnamesused, true, $side); } - - if (isadmin()) { - print_admin_links($site->id); - } - ?> -
- 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 -
"; - } 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); - } - ?> - -
- id)) { - $site->summary .= "
"; + echo "
"; + popup_form("$CFG->wwwroot/course/mod.php?id=$site->id§ion=0&add=", + $modnames, "section0", "", "Add..."); + echo "
"; } - print_simple_box($site->summary, "", "100%", $THEME->cellheading); + + 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); - ?> -
"; $firstcolumn=true; + } + 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"); + } + + 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 +
"; + } 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 "