--- loncom/interface/lonhtmlcommon.pm 2012/12/18 15:27:46 1.338
+++ loncom/interface/lonhtmlcommon.pm 2013/01/03 20:02:12 1.340
@@ -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.340 2013/01/03 20:02:12 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);
@@ -1896,7 +1909,7 @@ returns: nothing
sub docs_breadcrumbs {
my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_;
my ($folderpath,@folders);
- my @folders = split('&',$env{'form.folderpath'});
+ @folders = split('&',$env{'form.folderpath'});
my $plain='';
my $container = 'sequence';
my ($randompick,$isencrypted,$ishidden,$is_random_order) = (-1,0,0,0);
@@ -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) {