--- loncom/interface/loncommon.pm 2024/01/10 20:07:37 1.1426 +++ loncom/interface/loncommon.pm 2024/03/03 00:08:37 1.1427 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1426 2024/01/10 20:07:37 raeburn Exp $ +# $Id: loncommon.pm,v 1.1427 2024/03/03 00:08:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6950,21 +6950,33 @@ sub bodytag { $bodytag .= Apache::lonhtmlcommon::scripttag( Apache::lonmenu::utilityfunctions($httphost), 'start'); + my $collapsible; if ($args->{'collapsible_header'} ne '') { - my $alttext = &mt('menu state: collapsed'); - my $tooltip = &mt('display standard menus'); + $collapsible = 1; + my ($menustate,$tiptext,$divclass); + if ($args->{'start_collapsed'}) { + $menustate = 'collapsed'; + $tiptext = 'display'; + $divclass = 'hidden'; + } else { + $menustate = 'expanded'; + $tiptext = 'hide'; + $divclass = 'shown'; + } + my $alttext = &mt('menu state: '.$menustate); + my $tooltip = &mt($tiptext.' standard menus'); $bodytag .= <<"END";
-$alttext
- +
END } unless ($args->{'no_primary_menu'}) { my ($left,$right) = Apache::lonmenu::primary_menu($crstype,$ltimenu,$menucoll,$menuref, $args->{'links_disabled'}, $args->{'links_target'}, - $args->{'collapsible_header'}); + $collapsible); if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { if ($dc_info) {