From b3a2b9dd49beeb59d43548b725b0cdd230594682 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 11 Jan 2005 08:26:35 +0000 Subject: [PATCH] SMall cleanups on print_footer, and you can now call it with "none" --- lib/weblib.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 951255f2fd..0eaf75361d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1669,32 +1669,40 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='', * @param ? $usercourse ? * @todo Finish documenting this function */ -function print_footer ($course=NULL, $usercourse=NULL) { +function print_footer($course=NULL, $usercourse=NULL) { global $USER, $CFG, $THEME; /// Course links if ($course) { - if ($course == 'home') { // special case for site home page - please do not remove + if ($course == 'none') { // Don't print any links etc + $homelink = ''; + $loggedinas = ''; + } else if ($course == 'home') { // special case for site home page - please do not remove + $course = get_site(); $homelink = ''; $homelink .= '
moodlelogo
'; - $course = get_site(); - $homepage = true; + $homepage = true; } else { - $homelink = "framename}\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname"; + $homelink = ''.$course->shortname.''; } } else { - $homelink = "framename}\" href=\"$CFG->wwwroot/\">".get_string('home').''; - $course = get_site(); + $course = get_site(); // Set course as site course by default + $homelink = ''.get_string('home').''; } - if (!$usercourse) { +/// Set the user link if necessary + if (!$usercourse and is_object($course)) { $usercourse = $course; } -/// User links - $loggedinas = user_login_string($usercourse, $USER); + if (!isset($loggedinas)) { + $loggedinas = user_login_string($usercourse, $USER); + } + +/// Include the actual footer file - include ($CFG->dirroot .'/theme/'. $CFG->theme .'/footer.html'); + include ($CFG->dirroot.'/theme/'.$CFG->theme.'/footer.html'); } /** -- 2.39.5