--- loncom/interface/lonmenu.pm 2023/10/08 15:21:48 1.369.2.83.2.12 +++ loncom/interface/lonmenu.pm 2023/12/29 19:53:25 1.369.2.83.2.13 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.369.2.83.2.12 2023/10/08 15:21:48 raeburn Exp $ +# $Id: lonmenu.pm,v 1.369.2.83.2.13 2023/12/29 19:53:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -370,6 +370,19 @@ sub primary_menu { ($item->[2] eq 'blog')) && (!&Apache::lonnet::usertools_access('','',$item->[2], undef,'tools'))); + if ($item->[2] eq 'browsepub') { + if ($env{'request.role'} =~ /^au\./) { + $item->[0] = '/res/'.$env{'request.role.domain'}.'/?launch=1'; + } elsif ($env{'request.role'} =~ /^ca\./($match_domain)/($match_user)$/) { + $item->[0] = '/res/'.$1.'/'.$2.'/?launch=1'; + } elsif (&Apache::lonnet::allowed('bre',$env{'user.domain'})) { + $item->[0] = '/res/'.$env{'user.domain'}.'/?launch=1'; + } elsif (&Apache::lonnet::allowed('bro','/res/')) { + $item->[0] = '/res/?launch=1'; + } else { + next; + } + } if ($env{'request.course.id'} && $menucoll) { next if ($item->[3]) && (!$menuopts{$item->[3]}); } @@ -1256,8 +1269,16 @@ s&6&1&list.png&Directory&dir[_1]&golist( s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource +ENDMENUITEMS + +# +# Print only makes sense for certain mime types +# + if ($thisdisfn=~/\.(xml|html|htm|xhtml|xhtm|tex)$/ || $thisdisfn=~/$LONCAPA::assess_re/) { + $menuitems .= (<