--- loncom/interface/lonmenu.pm 2023/11/03 01:12:15 1.541 +++ loncom/interface/lonmenu.pm 2024/04/19 03:48:22 1.549 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.541 2023/11/03 01:12:15 raeburn Exp $ +# $Id: lonmenu.pm,v 1.549 2024/04/19 03:48:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -245,7 +245,7 @@ sub prep_menuitem { # @primary_menu is filled within the BEGIN block of this module with # entries from mydesk.tab sub primary_menu { - my ($crstype,$ltimenu,$menucoll,$menuref,$links_disabled,$links_target) = @_; + my ($crstype,$ltimenu,$menucoll,$menuref,$links_disabled,$links_target,$collapsible) = @_; my (%menu,%ltiexc,%menuopts); # each element of @primary contains following array: # (link url, icon path, alt text, link text, condition, position) @@ -366,6 +366,19 @@ sub primary_menu { ($item->[2] eq 'blog')) && (!&Apache::lonnet::usertools_access('','',$item->[2], undef,'tools'))); + if (($item->[2] eq 'browsepub') && ($item->[0] eq '/res/')) { + if ($env{'request.role'} =~ /^au\./) { + $item->[0] .= $env{'request.role.domain'}.'/?launch=1'; + } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) { + $item->[0] .= $1.'/'.$2.'/?launch=1'; + } elsif (&Apache::lonnet::allowed('bre',$env{'user.domain'})) { + $item->[0] .= $env{'user.domain'}.'/?launch=1'; + } elsif (&Apache::lonnet::allowed('bro','/res/')) { + $item->[0] .= '?launch=1'; + } else { + next; + } + } if ($env{'request.course.id'} && $menucoll) { next if ($item->[3]) && (!$menuopts{$item->[3]}); } @@ -421,6 +434,10 @@ sub primary_menu { } my @output = ('',''); if ($menu{'left'} ne '') { + if ($collapsible) { + $menu{'left'} = ($listclass?'
  • ':'
  • '). + ' 
  • '.$menu{'left'}; + } $output[0] = "
      $menu{'left'}
    "; } if ($menu{'right'} ne '') { @@ -894,6 +911,7 @@ sub innerregister { $ltiscope,$ltiuri,$showncrumbsref) = @_; my $const_space = ($env{'request.state'} eq 'construct'); my $is_const_dir = 0; + my $in_daxe = 0; if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; } @@ -1282,9 +1300,42 @@ s&7&4&rename.png&Rename&resource[_5]&goc s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource ENDMENUITEMS } - $menuitems .= (<