Diff for /loncom/interface/loncommon.pm between versions 1.1075.2.161.2.7 and 1.1075.2.161.2.8

version 1.1075.2.161.2.7, 2022/05/31 23:11:47 version 1.1075.2.161.2.8, 2022/07/08 16:01:54
Line 5898  Inputs: Line 5898  Inputs:
             context, this will contain a reference to hash of items              context, this will contain a reference to hash of items
             to be included in the page header and/or inline menu.              to be included in the page header and/or inline menu.
   
   =item * $menucoll, optional argument, if specific menu collection is in
               effect, either set as the default for the course, or set for
               the deeplink paramater for $env{'request.deeplink.login'}
               then $menucoll will be the number of that collection.
   
   =item * $menuref, optional argument, reference to a hash, containing the
               menu options included for the menu in effect, based on the
               configuration for the numbered menu collection in use.
   
   =item * $showncrumbsref, reference to a scalar. Calls to lonmenu::innerregister
               within &bodytag() can result in calls to lonhtmlcommon::breadcrumbs(),
               if so, $showncrumbsref is set there to 1, and will propagate back
               via &bodytag() to &start_page(), to prevent lonhtmlcommon::breadcrumbs()
               being called a second time.
   
 =back  =back
   
 Returns: A uniform header for LON-CAPA web pages.    Returns: A uniform header for LON-CAPA web pages.  
Line 5910  other decorations will be returned. Line 5925  other decorations will be returned.
 sub bodytag {  sub bodytag {
     my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,      my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
         $no_nav_bar,$bgcolor,$no_inline_link,$args,$advtoolsref,          $no_nav_bar,$bgcolor,$no_inline_link,$args,$advtoolsref,
         $ltiscope,$ltiuri,$ltimenu,$menucoll,$menuref)=@_;          $ltiscope,$ltiuri,$ltimenu,$menucoll,$menuref,$showncrumbsref)=@_;
   
     my $public;      my $public;
     if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))      if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
Line 6103  sub bodytag { Line 6118  sub bodytag {
             $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');              $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
             if ($env{'request.state'} eq 'construct') {              if ($env{'request.state'} eq 'construct') {
                 $bodytag .= &Apache::lonmenu::innerregister($forcereg,                  $bodytag .= &Apache::lonmenu::innerregister($forcereg,
                                 $args->{'bread_crumbs'},'','',$hostname,$ltiscope,$ltiuri);                                  $args->{'bread_crumbs'},'','',$hostname,
                                   $ltiscope,$ltiuri,$showncrumbsref);
             } elsif ($forcereg) {              } elsif ($forcereg) {
                 $bodytag .= &Apache::lonmenu::innerregister($forcereg,undef,                  $bodytag .= &Apache::lonmenu::innerregister($forcereg,undef,
                                                             $args->{'group'},                                  $args->{'group'},$args->{'hide_buttons'},
                                                             $args->{'hide_buttons'},                                  $hostname,$ltiscope,$ltiuri,$showncrumbsref);
                                                             $hostname,$ltiscope,$ltiuri);  
             } else {              } else {
                 my $forbodytag;                  my $forbodytag;
                 &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},                  &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
Line 8820  sub start_page { Line 8835  sub start_page {
         }          }
     }      }
   
       my $showncrumbs;
     if (! exists($args->{'skip_phases'}{'body'}) ) {      if (! exists($args->{'skip_phases'}{'body'}) ) {
  if ($args->{'frameset'}) {   if ($args->{'frameset'}) {
     my $attr_string = &make_attr_string($args->{'force_register'},      my $attr_string = &make_attr_string($args->{'force_register'},
Line 8833  sub start_page { Line 8849  sub start_page {
                          $args->{'force_register'}, $args->{'no_nav_bar'},                           $args->{'force_register'}, $args->{'no_nav_bar'},
                          $args->{'bgcolor'},        $args->{'no_inline_link'},                           $args->{'bgcolor'},        $args->{'no_inline_link'},
                          $args,                     \@advtools,                           $args,                     \@advtools,
                          $ltiscope,$ltiuri,\%ltimenu,$menucoll,\%menu);                           $ltiscope,$ltiuri,\%ltimenu,$menucoll,\%menu,\$showncrumbs);
         }          }
     }      }
   
Line 8855  sub start_page { Line 8871  sub start_page {
   
     #Breadcrumbs      #Breadcrumbs
     if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {      if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
           unless ($showncrumbs) {
  &Apache::lonhtmlcommon::clear_breadcrumbs();   &Apache::lonhtmlcommon::clear_breadcrumbs();
  #if any br links exists, add them to the breadcrumbs   #if any br links exists, add them to the breadcrumbs
  if (exists($args->{'bread_crumbs'}) and ref($args->{'bread_crumbs'}) eq 'ARRAY') {            if (exists($args->{'bread_crumbs'}) and ref($args->{'bread_crumbs'}) eq 'ARRAY') {         
Line 8874  sub start_page { Line 8891  sub start_page {
                 } else {                  } else {
                     undef($menulink);                      undef($menulink);
                 }                  }
                   my $linkprotout;
                   if ($env{'request.deeplink.login'}) {
                       my $linkprotout = &Apache::lonmenu::linkprot_exit();
                       if ($linkprotout) {
                           &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout);
                       }
                   }
  #if bread_crumbs_component exists show it as headline else show only the breadcrumbs   #if bread_crumbs_component exists show it as headline else show only the breadcrumbs
  if(exists($args->{'bread_crumbs_component'})){   if(exists($args->{'bread_crumbs_component'})){
  $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'},'',$menulink);   $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'},'',$menulink);
  } else {   } else {
  $result .= &Apache::lonhtmlcommon::breadcrumbs('','',$menulink);   $result .= &Apache::lonhtmlcommon::breadcrumbs('','',$menulink);
  }   }
           }
     } elsif (($env{'environment.remote'} eq 'on') &&      } elsif (($env{'environment.remote'} eq 'on') &&
              ($env{'form.inhibitmenu'} ne 'yes') &&               ($env{'form.inhibitmenu'} ne 'yes') &&
              ($env{'request.noversionuri'} =~ m{^/res/}) &&               ($env{'request.noversionuri'} =~ m{^/res/}) &&

Removed from v.1.1075.2.161.2.7  
changed lines
  Added in v.1.1075.2.161.2.8


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