Diff for /loncom/interface/lonmenu.pm between versions 1.369.2.83.2.3 and 1.369.2.83.2.4

version 1.369.2.83.2.3, 2022/05/30 15:40:15 version 1.369.2.83.2.4, 2022/07/08 16:08:05
Line 822  sub registerurl { Line 822  sub registerurl {
 }  }
   
 sub innerregister {  sub innerregister {
     my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname) = @_;      my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname,
           $ltiscope,$ltiuri,$showncrumbsref) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');      my $const_space = ($env{'request.state'} eq 'construct');
     my $is_const_dir = 0;      my $is_const_dir = 0;
   
Line 919  sub innerregister { Line 920  sub innerregister {
                 if ($env{'form.folderpath'}) {                  if ($env{'form.folderpath'}) {
                     &prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname);                      &prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname);
                     ($trail) =                      ($trail) =
                         &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                          &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1);
                 } else {                  } else {
                     &Apache::lonhtmlcommon::add_breadcrumb(                      &Apache::lonhtmlcommon::add_breadcrumb(
                     {text  => "Supplemental $crstype Content",                      {text  => "Supplemental $crstype Content",
                      href  => "javascript:gopost('/adm/supplemental','')"});                       href  => "javascript:gopost('/adm/supplemental','')"});
                     $title = &mt('View Resource');                      $title = &mt('View Resource');
                     ($trail) =                      ($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;                  return $trail;
             } elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) {              } elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) {
Line 935  sub innerregister { Line 939  sub innerregister {
                                    $forcereg,$group,undef,undef,1,$hostname);                                     $forcereg,$group,undef,undef,1,$hostname);
                 $title = &mt('Syllabus File');                  $title = &mt('Syllabus File');
                 my ($trail) =                  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;                  return $trail;
             }              }
             unless ($env{'request.state'} eq 'construct') {              unless ($env{'request.state'} eq 'construct') {
Line 1193  ENDMENUITEMS Line 1200  ENDMENUITEMS
                 }                  }
             }              }
         }          }
           my $linkprotout;
           if ($env{'request.deeplink.login'}) {
               $linkprotout = &linkprot_exit();
           }
         if ($noremote) {          if ($noremote) {
     my $addremote=0;      my $addremote=0;
     foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }      foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
Line 1218  ENDMENUITEMS Line 1229  ENDMENUITEMS
                     if ($countdown) {                      if ($countdown) {
                         &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);                          &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
                     }                      }
                       if ($linkprotout) {
                           &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout);
                       }
                 } else {                  } else {
                     my @tools = @inlineremote[93,91,81,82,83];                      my @tools = @inlineremote[93,91,81,82,83];
                     if ($countdown) {                      if ($countdown) {
                         unshift(@tools,$countdown);                          unshift(@tools,$countdown);
                     }                      }
                       if ($linkprotout) {
                           unshift(@tools,$linkprotout);
                       }
                     &Apache::lonhtmlcommon::add_breadcrumb_tool(                      &Apache::lonhtmlcommon::add_breadcrumb_tool(
                         'tools',@tools);                          'tools',@tools);
   
Line 1236  ENDMENUITEMS Line 1253  ENDMENUITEMS
                     }                      }
                     &advtools_crumbs(@inlineremote);                      &advtools_crumbs(@inlineremote);
                 }                  }
               } else {
                   if ($linkprotout) {
                       &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout);
                   }
             }              }
             my ($topic_help,$topic_help_text);              my ($topic_help,$topic_help_text);
             if ($is_const_dir == 2) {              if ($is_const_dir == 2) {
Line 1247  ENDMENUITEMS Line 1268  ENDMENUITEMS
                     $topic_help_text = 'About WebDAV access';                      $topic_help_text = 'About WebDAV access';
                 }                  }
             }              }
               if (ref($showncrumbsref)) {
                   $$showncrumbsref = 1;
               }
             return   &Apache::lonhtmlcommon::scripttag('', 'start')              return   &Apache::lonhtmlcommon::scripttag('', 'start')
                    . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'','','','',$topic_help,$topic_help_text)                     . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'','','','',$topic_help,$topic_help_text)
                    . &Apache::lonhtmlcommon::scripttag('', 'end');                     . &Apache::lonhtmlcommon::scripttag('', 'end');
Line 3428  END Line 3452  END
         }          }
     }      }
     return;      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 <<END;
   <form method="post" name="LCexitButton" action="/adm/linkexit">
       <input type="hidden" name="LC_deeplink_exit" value="" />
       <button id="LC_exit-confirm-opener" type="button">$exitbuttontext</button>
   </form>
   
   <div id="LC_exit-confirm" title="$lt{'title'}">
       <p>$lt{'okdone'} $lt{'cancel'}</p>
   </div>
   
   <script type="text/javascript">
   // <![CDATA[
   \$( "#LC_exit-confirm" ).dialog({ autoOpen: false });
   \$( "#LC_exit-confirm-opener" ).click(function() {
       \$( "#LC_exit-confirm" ).dialog( "open" );
       \$( "#LC_exit-confirm" ).dialog({
         resizable: false,
         height: $height,
         width: $width,
         modal: true,
         buttons: [
                    {
                       text: "$lt{'ok'}",
                       click: function() {
                           \$( this ).dialog( "close" );
                           \$( '[name="LC_deeplink_exit"]' )[0].value = 'true';
                           \$( '[name="LCexitButton"]' )[0].submit();
                       },
                    },
                    {
                        text: "$lt{'exit'}",
                        click: function() {
                            \$( this ).dialog( "close" );
                        },
                     },
                  ],
          });
   });
   // ]]>
   </script>
   
   END
                           }
                       }
                   }
               }
           }
       }
       return;
 }  }
   
 # ================================================================ Main Program  # ================================================================ Main Program

Removed from v.1.369.2.83.2.3  
changed lines
  Added in v.1.369.2.83.2.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>