From: moodler Date: Tue, 11 Jan 2005 08:26:35 +0000 (+0000) Subject: SMall cleanups on print_footer, and you can now call it with "none" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b3a2b9dd49beeb59d43548b725b0cdd230594682;p=moodle.git SMall cleanups on print_footer, and you can now call it with "none" --- 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'); } /**