Diff for /loncom/interface/loncommon.pm between versions 1.1356 and 1.1357

version 1.1356, 2021/04/11 18:05:43 version 1.1357, 2021/04/19 23:07:34
Line 6144  sub bodytag { Line 6144  sub bodytag {
     if ($realm) {      if ($realm) {
         $realm = '/'.$realm;          $realm = '/'.$realm;
     }      }
     if ($role  eq 'ca') {      if ($role eq 'ca') {
         my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$});          my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$});
         $realm = &plainname($rname,$rdom);          $realm = &plainname($rname,$rdom);
     }       } 
 # realm  # realm
       my ($cid,$sec);
     if ($env{'request.course.id'}) {      if ($env{'request.course.id'}) {
           $cid = $env{'request.course.id'};
           if ($env{'request.course.sec'}) {
               $sec = $env{'request.course.sec'};
           }
       } elsif ($realm =~ m{^/($match_domain)/($match_courseid)(?:|/(\w+))$}) {
           if (&Apache::lonnet::is_course($1,$2)) {
               $cid = $1.'_'.$2;
               $sec = $3;
           }
       }
       if ($cid) {
         if ($env{'request.role'} !~ /^cr/) {          if ($env{'request.role'} !~ /^cr/) {
             $role = &Apache::lonnet::plaintext($role,&course_type());              $role = &Apache::lonnet::plaintext($role,&course_type());
         } elsif ($role =~ m{^cr/($match_domain)/\1-domainconfig/(\w+)$}) {          } elsif ($role =~ m{^cr/($match_domain)/\1-domainconfig/(\w+)$}) {
Line 6161  sub bodytag { Line 6173  sub bodytag {
         } else {          } else {
             $role = (split(/\//,$role,4))[-1];               $role = (split(/\//,$role,4))[-1]; 
         }          }
         if ($env{'request.course.sec'}) {          if ($sec) {
             $role .= (' 'x2).'- '.&mt('section:').' '.$env{'request.course.sec'};              $role .= (' 'x2).'- '.&mt('section:').' '.$sec;
         }             }   
  $realm = $env{'course.'.$env{'request.course.id'}.'.description'};   $realm = $env{'course.'.$cid.'.description'};
     } else {      } else {
         $role = &Apache::lonnet::plaintext($role);          $role = &Apache::lonnet::plaintext($role);
     }      }
Line 6187  sub bodytag { Line 6199  sub bodytag {
  undef($role);   undef($role);
     }      }
   
     if (($env{'request.course.id'}) && ($env{'request.lti.login'})) {      if (($cid) && ($env{'request.lti.login'})) {
         if (ref($ltimenu) eq 'HASH') {          if (ref($ltimenu) eq 'HASH') {
             unless ($ltimenu->{'role'}) {              unless ($ltimenu->{'role'}) {
                 undef($role);                  undef($role);
Line 6202  sub bodytag { Line 6214  sub bodytag {
     #      #
     # Extra info if you are the DC      # Extra info if you are the DC
     my $dc_info = '';      my $dc_info = '';
     if ($env{'user.adv'} && exists($env{'user.role.dc./'.      if (($env{'user.adv'}) && ($env{'request.course.id'}) &&
                         $env{'course.'.$env{'request.course.id'}.          (exists($env{'user.role.dc./'.$env{'course.'.$cid.'.domain'}.'/'}))) {
                                  '.domain'}.'/'})) {  
         my $cid = $env{'request.course.id'};  
         $dc_info = $cid.' '.$env{'course.'.$cid.'.internal.coursecode'};          $dc_info = $cid.' '.$env{'course.'.$cid.'.internal.coursecode'};
         $dc_info =~ s/\s+$//;          $dc_info =~ s/\s+$//;
     }      }
   
     my $crstype;      my $crstype;
     if ($env{'request.course.id'}) {      if ($cid) {
         $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};          $crstype = $env{'course.'.$cid.'.type'};
     } elsif ($args->{'crstype'}) {      } elsif ($args->{'crstype'}) {
         $crstype = $args->{'crstype'};          $crstype = $args->{'crstype'};
     }      }

Removed from v.1.1356  
changed lines
  Added in v.1.1357


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