diff --git a/lib/weblib.php b/lib/weblib.php index d5411e40b13..3f50f4bd69d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1568,6 +1568,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta= } } + /// Add the required stylesheets $stylesheetshtml = ''; foreach ($CFG->stylesheets as $stylesheet) { @@ -1583,6 +1584,13 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta= $home = false; } +/// This is another ugly hack to make navigation elements available to print_footer later + $THEME->title = $title; + $THEME->heading = $heading; + $THEME->navigation = $navigation; + $THEME->button = $button; + $THEME->menu = $menu; + if ($button == '') { $button = ' '; } @@ -1763,27 +1771,37 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='', * @todo Finish documenting this function */ function print_footer($course=NULL, $usercourse=NULL) { - global $USER, $CFG; + global $USER, $CFG, $THEME; /// Course links if ($course) { if ($course == 'none') { // Don't print any links etc $homelink = ''; $loggedinas = ''; + $home = false; } else if ($course == 'home') { // special case for site home page - please do not remove $course = get_site(); $homelink = ''; $homelink .= '
moodlelogo
'; - $homepage = true; + $home = true; } else { $homelink = ''.$course->shortname.''; + $home = false; } } else { $course = get_site(); // Set course as site course by default $homelink = ''.get_string('home').''; + $home = false; } +/// Set up some other navigation links (passed from print_header by ugly hack) + $menu = isset($THEME->menu) ? $THEME->menu : ''; + $title = isset($THEME->title) ? $THEME->title : ''; + $button = isset($THEME->button) ? $THEME->button : ''; + $heading = isset($THEME->heading) ? $THEME->heading : ''; + $navigation = isset($THEME->navigation) ? $THEME->navigation : ''; + /// Set the user link if necessary if (!$usercourse and is_object($course)) { $usercourse = $course; @@ -1793,6 +1811,11 @@ function print_footer($course=NULL, $usercourse=NULL) { $loggedinas = user_login_string($usercourse, $USER); } + if ($loggedinas == $menu) { + $loggedinas = ''; + } + + /// Include the actual footer file include ($CFG->themedir.$CFG->theme.'/footer.html');