--- loncom/interface/lonhtmlcommon.pm 2012/12/18 15:27:46 1.338 +++ loncom/interface/lonhtmlcommon.pm 2012/12/22 14:45:35 1.339 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.338 2012/12/18 15:27:46 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.339 2012/12/22 14:45:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1761,11 +1761,24 @@ returns: nothing .$links ; } - - &render_tools(\$links); - $links = &htmltag('div', $links, - { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ; - &render_advtools(\$links); + my $nav_and_tools = 0; + foreach my $item ('navigation','tools') { + if (ref($tools{$item}) eq 'ARRAY') { + $nav_and_tools += scalar(@{$tools{$item}}) + } + } + if (($links ne '') || ($nav_and_tools)) { + &render_tools(\$links); + $links = &htmltag('div', $links, + { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ; + } + my $adv_tools = 0; + if (ref($tools{'advtools'}) eq 'ARRAY') { + $adv_tools = scalar(@{$tools{'advtools'}}); + } + if (($links ne '') || ($adv_tools)) { + &render_advtools(\$links); + } # Return the @Crumbs stack to what we started with push(@Crumbs,$last); @@ -3026,7 +3039,10 @@ PARAMSONE } if ((chkh == 1) || (listwchange)) { var primaryheight = document.getElementById('LC_nav_bar').offsetHeight; - var secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight; + var secondaryheight; + if (document.getElementById('LC_secondary_menu') != null) { + secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight; + } var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight; var dccidheight = 0; if (document.getElementById('dccid') != null) {