Diff for /rat/lonwrapper.pm between versions 1.49.2.11.2.5 and 1.86

version 1.49.2.11.2.5, 2023/10/06 17:35:54 version 1.86, 2023/12/31 21:45:03
Line 82  sub wrapper { Line 82  sub wrapper {
         }          }
     }      }
   
     my $noiframe = &Apache::loncommon::modal_link($url.$anchor,$lt{'show'},500,400);      my $noiframe = &Apache::loncommon::modal_link(&HTML::Entities::encode($url.$anchor,'&<>"\''),$lt{'show'},500,400);
     my $args = {'bgcolor' => '#FFFFFF'};      my $args = {'bgcolor' => '#FFFFFF'};
     if ($forcereg) {      if ($forcereg) {
         $args->{'force_register'} = $forcereg;          $args->{'force_register'} = $forcereg;
Line 153  sub wrapper { Line 153  sub wrapper {
 #  #
   
     unless ($clientmobile || ($exttool eq 'window') || ($exttool eq 'tab') || $uselink) {      unless ($clientmobile || ($exttool eq 'window') || ($exttool eq 'tab') || $uselink) {
         $headjs = '          $headjs = &Apache::loncommon::iframe_wrapper_headjs();
 <script type="text/javascript">  
 // <![CDATA[  
 var LCnotready = 0;  
 var LCresizedef = 0;  
 // ]]>  
 </script>'."\n";  
     }      }
   
     my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args).$countdown.$donemsg;      my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args).$countdown.$donemsg;
Line 302  ENDLINK Line 296  ENDLINK
         $linktext = &mt('Link to resource');          $linktext = &mt('Link to resource');
         return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage;          return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage;
     } else {      } else {
         my $offset = 5;  
         &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']);  
         if (($env{'form.inhibitmenu'} eq 'yes') || ($env{'form.only_body'})) {  
             $offset = 0;  
         }  
         my $script = &Apache::lonhtmlcommon::scripttag(<<SCRIPT);  
         \$(document).ready( function() {  
             \$(window).unbind('resize').resize(function(){  
                 var header = null;  
                 var offset = $offset;  
                 var height = 0;  
                 var hdrtop = 0;  
                 if (\$('div.LC_head_subbox:first').length) {  
                     header = \$('div.LC_head_subbox:first');  
                     offset = 9;  
                 } else {  
                     if (\$('#LC_breadcrumbs').length) {  
                         header = \$('#LC_breadcrumbs');  
                     }  
                 }  
                 if (header != null && header.length) {  
                     height = header.height();  
                     hdrtop = header.position().top;  
                 }  
                 var pos = height + hdrtop + offset;  
                 \$('.LC_iframecontainer').css('top', pos);  
             });  
             LCresizedef = 1;  
             if (LCnotready == 1) {  
                 LCnotready = 0;  
                 \$(window).trigger('resize');  
             }  
         });  
         window.onload = function(){  
             if (LCresizedef) {  
                 LCnotready = 0;  
                 \$(window).trigger('resize');  
             } else {  
                 LCnotready = 1;  
             }  
         };  
 SCRIPT  
         # javascript will position the iframe if window was resized (or zoomed)          # javascript will position the iframe if window was resized (or zoomed)
           my $script = &Apache::loncommon::iframe_wrapper_resizejs();
         my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');          my $dest = &HTML::Entities::encode($url.$anchor,'&<>"');
         return <<ENDFRAME;          return <<ENDFRAME;
         $startpage          $startpage
Line 500  sub handler { Line 453  sub handler {
                 $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};                  $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
                 &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);                  &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);
             }              }
             unless ($env{'form.only_body'}) {               unless ($env{'form.only_body'}) {
                 $brcrum =                  $brcrum =
                     &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                      &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
             }              }
Line 584  described at http://www.lon-capa.org. Line 537  described at http://www.lon-capa.org.
   
 =over  =over
   
 =item wrapper($r,$url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$linktext,$explanation,$title,$width,$height,$reuse,$is_supp)  =item wrapper()
   
   Args: $r,$url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$linktext,$explanation,$title,$width,$height,$reuse,$is_supp
   
 =over  =over
   
Line 689  of all external resource instances in a Line 644  of all external resource instances in a
   
 Returns markup for the entire page.  Returns markup for the entire page.
   
   =item create_link()
   
   Args: $url,$anchor,$title,$linktext
   
   =over
   
   =item $url
   
   URL to link to
   
   =item $anchor
   
   optional.  Will be the anchor to append to the URL, if there is one.
   
   =item $title
   
   optional. If provided will be the title displayed above the link. If
   one is not provided, then $env{'form.title'} will be used, unless empty.
   
   =item $linktext
   
   The text to inlcude between the <a href="$url"> and </a> tags.
   
   =back
   
   Returns HTML needed to show a link which can be followed to display the
   part of the original URL following the initial /adm/wrapper part 
   in the original request, in the case where an iframe is not going to be
   used to embed the content available at the URL in the existing page.
   
 =item handler()  =item handler()
   
 Content handler for requests for: /adm/wrapper/...  Content handler for requests for: /adm/wrapper/...

Removed from v.1.49.2.11.2.5  
changed lines
  Added in v.1.86


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