--- loncom/interface/lonmenu.pm 2022/05/29 21:49:06 1.369.2.83.2.2 +++ loncom/interface/lonmenu.pm 2022/07/08 16:08:05 1.369.2.83.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.369.2.83.2.2 2022/05/29 21:49:06 raeburn Exp $ +# $Id: lonmenu.pm,v 1.369.2.83.2.4 2022/07/08 16:08:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -522,7 +522,7 @@ sub secondary_menu { if ($links_target ne '') { $target = $links_target; } else { - my $deeplinktarget + my $deeplinktarget; if ($env{'request.deeplink.login'}) { $deeplinktarget = $env{'request.deeplink.target'}; } @@ -779,6 +779,7 @@ sub build_submenu { unless (($href eq '') || ($href =~ /^\#/)) { if ($target ne '') { $targetattr = ' target="'.$target.'"'; + } } $menu .= '
  • "Supplemental $crstype Content", href => "javascript:gopost('/adm/supplemental','')"}); $title = &mt('View Resource'); ($trail) = - &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); + &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); + } + if (ref($showncrumbsref)) { + $$showncrumbsref = 1; } return $trail; } elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) { @@ -934,7 +939,10 @@ sub innerregister { $forcereg,$group,undef,undef,1,$hostname); $title = &mt('Syllabus File'); my ($trail) = - &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,$hostname); + &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); + if (ref($showncrumbsref)) { + $$showncrumbsref = 1; + } return $trail; } unless ($env{'request.state'} eq 'construct') { @@ -1192,6 +1200,10 @@ ENDMENUITEMS } } } + my $linkprotout; + if ($env{'request.deeplink.login'}) { + $linkprotout = &linkprot_exit(); + } if ($noremote) { my $addremote=0; foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} } @@ -1217,11 +1229,17 @@ ENDMENUITEMS if ($countdown) { &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown); } + if ($linkprotout) { + &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout); + } } else { my @tools = @inlineremote[93,91,81,82,83]; if ($countdown) { unshift(@tools,$countdown); } + if ($linkprotout) { + unshift(@tools,$linkprotout); + } &Apache::lonhtmlcommon::add_breadcrumb_tool( 'tools',@tools); @@ -1235,6 +1253,10 @@ ENDMENUITEMS } &advtools_crumbs(@inlineremote); } + } else { + if ($linkprotout) { + &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout); + } } my ($topic_help,$topic_help_text); if ($is_const_dir == 2) { @@ -1246,6 +1268,9 @@ ENDMENUITEMS $topic_help_text = 'About WebDAV access'; } } + if (ref($showncrumbsref)) { + $$showncrumbsref = 1; + } return &Apache::lonhtmlcommon::scripttag('', 'start') . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'','','','',$topic_help,$topic_help_text) . &Apache::lonhtmlcommon::scripttag('', 'end'); @@ -3427,6 +3452,94 @@ END } } return; +} + +sub linkprot_exit { + if (($env{'request.course.id'}) && ($env{'request.deeplink.login'})) { + my ($deeplink_symb,$deeplink); + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + if (($cnum ne '') && ($cdom ne '')) { + $deeplink_symb = &Apache::loncommon::deeplink_login_symb($cnum,$cdom); + if ($deeplink_symb) { + if ($deeplink_symb =~ /\.(page|sequence)$/) { + my $mapname = &Apache::lonnet::deversion((&Apache::lonnet::decode_symb($deeplink_symb))[2]); + my $navmap = Apache::lonnavmaps::navmap->new(); + if (ref($navmap)) { + $deeplink = $navmap->get_mapparam(undef,$mapname,'0.deeplink'); + } + } else { + $deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$deeplink_symb); + } + if ($deeplink ne '') { + my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink); + my %lt = &Apache::lonlocal::texthash( + title => 'Exit Tool', + okdone => 'Click "OK" to exit embedded tool', + cancel => 'Click "Cancel" to continue working.', + ok => 'OK', + exit => 'Cancel', + ); + if ($exit) { + my ($show,$text) = split(/:/,$exit); + unless ($show eq 'no') { + my $height = 250; + my $width = 300; + my $exitbuttontext; + if ($text eq '') { + $exitbuttontext = &mt('Exit Tool'); + } else { + $exitbuttontext = $text; + } + return < + + + + +
    +

    $lt{'okdone'} $lt{'cancel'}

    +
    + + + +END + } + } + } + } + } + } + return; } # ================================================================ Main Program