--- loncom/interface/loncommon.pm 2024/10/06 00:30:26 1.1075.2.171 +++ loncom/interface/loncommon.pm 2024/10/07 21:20:09 1.1075.2.172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.171 2024/10/06 00:30:26 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.172 2024/10/07 21:20:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5820,14 +5820,19 @@ sub bodytag { unless (ref($args->{'bread_crumbs'}) eq 'ARRAY') { $funclist = $forbodytag; } + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); } else { # if ($env{'request.state'} eq 'construct') { # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls # } - $bodytag .= Apache::lonhtmlcommon::scripttag( - Apache::lonmenu::utilityfunctions($httphost), 'start'); + my $need_endlcint; + unless ($args->{'switchserver'}) { + $bodytag .= Apache::lonhtmlcommon::scripttag( + Apache::lonmenu::utilityfunctions($httphost), 'start'); + $need_endlcint = 1; + } if (($env{'environment.remote'} eq 'on') && ($env{'request.state'} eq 'construct')) { unless ($env{'form.inhibitmenu'}) { @@ -5842,7 +5847,9 @@ sub bodytag { } $bodytag .= qq|
$left $role
$realm $dc_info
|; - + if ($need_endlcint) { + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + } return $bodytag; } @@ -5860,6 +5867,9 @@ sub bodytag { #if directed to not display the secondary menu, don't. if ($args->{'no_secondary_menu'}) { + if ($need_endlcint) { + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + } return $bodytag; } #don't show menus for public users @@ -5869,7 +5879,9 @@ sub bodytag { $bodytag .= Apache::lonmenu::secondary_menu($httphost,$args->{'links_disabled'}); } $bodytag .= Apache::lonmenu::serverform(); - $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + if ($need_endlcint) { + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + } if ($env{'request.state'} eq 'construct') { $bodytag .= &Apache::lonmenu::innerregister($forcereg, $args->{'bread_crumbs'},'','',$hostname); @@ -5889,11 +5901,13 @@ sub bodytag { $bodytag .= $forbodytag; } } - }else{ - # this is to seperate menu from content when there's no secondary + } else { + # this is to separate menu from content when there's no secondary # menu. Especially needed for public accessible ressources. $bodytag .= '
'; - $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + if ($need_endlcint) { + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + } } return $bodytag; @@ -8122,7 +8136,7 @@ sub headtag { $inhibitprint = &print_suppression(); } - if (!$args->{'frameset'}) { + if (!$args->{'frameset'} && !$args->{'switchserver'}) { $result .= &Apache::lonhtmlcommon::htmlareaheaders(); } if ($args->{'force_register'}) { @@ -8130,7 +8144,8 @@ sub headtag { } if (!$args->{'no_nav_bar'} && !$args->{'only_body'} - && !$args->{'frameset'}) { + && !$args->{'frameset'} + && !$args->{'switchserver'}) { $result .= &help_menu_js($httphost); $result.=&modal_window(); $result.=&togglebox_script();