--- rat/lonwrapper.pm 2022/10/29 18:52:58 1.81 +++ rat/lonwrapper.pm 2023/12/31 21:45:03 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.81 2022/10/29 18:52:58 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.86 2023/12/31 21:45:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,7 +82,7 @@ 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'}; if ($forcereg) { $args->{'force_register'} = $forcereg; @@ -95,6 +95,8 @@ sub wrapper { } if ($env{'form.only_body'}) { $args->{'only_body'} = $env{'form.only_body'}; + } elsif (($is_supp) && ($env{'form.folderpath'} ne '')) { + $args->{'bread_crumbs_nomenu'} = 1; } my ($countdown,$donemsg,$headjs); @@ -151,13 +153,7 @@ sub wrapper { # unless ($clientmobile || ($exttool eq 'window') || ($exttool eq 'tab') || $uselink) { - $headjs = ' -'."\n"; + $headjs = &Apache::loncommon::iframe_wrapper_headjs(); } my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args).$countdown.$donemsg; @@ -300,49 +296,8 @@ ENDLINK $linktext = &mt('Link to resource'); return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage; } else { - my $offset = 5; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']); - if ($env{'form.inhibitmenu'} eq 'yes') { - $offset = 0; - } - my $script = &Apache::lonhtmlcommon::scripttag(<"'); return <&'); my $crstype = &Apache::loncommon::course_type(); - $brcrum = - &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); - + unless ($env{'form.only_body'}) { + $brcrum = + &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); + } } } @@ -572,7 +537,9 @@ described at http://www.lon-capa.org. =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 @@ -677,6 +644,36 @@ of all external resource instances in a 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 and 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() Content handler for requests for: /adm/wrapper/...