Diff for /loncom/interface/lonmenu.pm between versions 1.534 and 1.537

version 1.534, 2023/07/14 00:54:13 version 1.537, 2023/09/27 14:07:47
Line 968  sub innerregister { Line 968  sub innerregister {
                     $$showncrumbsref = 1;                      $$showncrumbsref = 1;
                 }                  }
                 return $trail;                  return $trail;
               } elsif (($resurl eq '/public'.$courseurl.'/syllabus') &&
                        ($env{'form.folderpath'})) {
                   if ($env{'form.title'}) {
                       $title = $env{'form.title'};
                   } else {
                       $title = 'Syllabus';
                   }
                   &prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname);
                   $title = &HTML::Entities::encode($title,'\'"<>&');
                   my ($trail) =
                       &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1);
                   return $trail;
             }              }
             unless ($env{'request.state'} eq 'construct') {              unless ($env{'request.state'} eq 'construct') {
                 &Apache::lonhtmlcommon::clear_breadcrumbs();                  &Apache::lonhtmlcommon::clear_breadcrumbs();
Line 1130  END Line 1142  END
 # End course context  # End course context
   
 # Prepare the rest of the buttons  # Prepare the rest of the buttons
         my ($menuitems,$got_prt,$got_wishlist);          my ($menuitems,$got_prt,$got_wishlist,$crsauthor);
         if ($const_space) {          if ($const_space) {
 #  #
 # We are in construction space  # We are in construction space
Line 1270  ENDMENUITEMS Line 1282  ENDMENUITEMS
             $got_prt = 1;              $got_prt = 1;
             if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/)              if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/)
                 && (!$env{'request.enc'})) {                  && (!$env{'request.enc'})) {
                 my ($cnum,$cdom) = &Apache::loncommon::crsauthor_url($env{'request.uri'});                  my $privurl = $env{'request.uri'};
                 unless ($cnum) {                  $privurl =~ s{^/res/}{/priv/};
                   my ($cnum,$cdom) = &Apache::loncommon::crsauthor_url($privurl);
                   if ($cnum) {
                       $crsauthor = 1;
                   } else {
                     # wishlist is only available for users with access to resource-pool                      # wishlist is only available for users with access to resource-pool
                     # and links can only be set for resources within the resource-pool                      # and links can only be set for resources within the resource-pool
                     $menuitems .= (<<ENDMENUITEMS);                      $menuitems .= (<<ENDMENUITEMS);
Line 1326  s&8&3&prt.png&Print&printout[_1]&gopost( Line 1342  s&8&3&prt.png&Print&printout[_1]&gopost(
 ENDMENUITEMS  ENDMENUITEMS
                 $got_prt = 1;                  $got_prt = 1;
             }              }
             unless ($got_wishlist) {              unless (($got_wishlist) || ($crsauthor)) {
                 if (($env{'user.adv'}) && (!$env{'request.enc'})) {                  if (($env{'user.adv'}) && (!$env{'request.enc'})) {
                     # wishlist is only available for users with access to resource-pool                      # wishlist is only available for users with access to resource-pool
                     $menuitems .= (<<ENDMENUITEMS);                      $menuitems .= (<<ENDMENUITEMS);
Line 2345  sub view_as_js { Line 2361  sub view_as_js {
     return <<"END";      return <<"END";
   
 function toggleViewAsUser(change) {  function toggleViewAsUser(change) {
     var seluserid = document.getElementById('LC_selectuser');      if (document.getElementById('LC_selectuser')) {
     var currstyle = seluserid.style.display;          var seluserid = document.getElementById('LC_selectuser');
     if (change == 'off') {          var currstyle = seluserid.style.display;
         document.userview.elements['LC_viewas'].value = '';          if (change == 'off') {
         document.userview.elements['vuname'].value = '';              document.userview.elements['LC_viewas'].value = '';
         document.userview.elements['vid'].value = '';              document.userview.elements['vuname'].value = '';
         document.userview.submit();              document.userview.elements['vid'].value = '';
         return;              document.userview.submit();
     }              return;
     if (currstyle == 'inline') {          }
         seluserid.style.display = 'none';          if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) {
         document.getElementById('usexpand').innerHTML='&#9658;&nbsp;';              if (currstyle == 'inline') {
         document.getElementById('uscollapse').innerHTML='';                  seluserid.style.display = 'none';
     } else {                  document.getElementById('usexpand').innerHTML='&#9658;&nbsp;';
         seluserid.style.display = 'inline';                  document.getElementById('uscollapse').innerHTML='';
         document.getElementById('usexpand').innerHTML='';              } else {
         document.getElementById('uscollapse').innerHTML='&#9668;&nbsp;';                  seluserid.style.display = 'inline';
                   document.getElementById('usexpand').innerHTML='';
                   document.getElementById('uscollapse').innerHTML='&#9668;&nbsp;';
               }
           }
     }      }
     return;      return;
 }  }

Removed from v.1.534  
changed lines
  Added in v.1.537


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