--- rat/lonwrapper.pm 2010/03/03 21:33:20 1.38 +++ rat/lonwrapper.pm 2013/10/15 10:17:19 1.45 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.38 2010/03/03 21:33:20 droeschl Exp $ +# $Id: lonwrapper.pm,v 1.45 2013/10/15 10:17:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,29 +33,64 @@ use strict; use Apache::Constants qw(:common); use Apache::lonenc(); use Apache::lonnet; +use Apache::lonlocal; +use Apache::loncommon(); +use Apache::lonhtmlcommon(); +use Apache::lonextresedit(); # ================================================================ Main Handler sub wrapper { - my $url = shift; + my ($url,$brcrum,$absolute,$is_ext) = @_; - my $startpage = Apache::loncommon::start_page('Menu',undef, - { 'force_register' =>1, 'bgcolor' => '#FFFFFF',}) ; + my $forcereg; + unless ($env{'form.folderpath'}) { + $forcereg = 1; + } + + my $args = {'bgcolor' => '#FFFFFF'}; + if ($forcereg) { + $args->{'force_register'} = $forcereg; + } + if (ref($brcrum) eq 'ARRAY') { + $args->{'bread_crumbs'} = $brcrum; + } + if ($absolute) { + $args->{'use_absolute'} = $absolute; + } + + my $startpage = Apache::loncommon::start_page('Menu',undef,$args); my $endpage = Apache::loncommon::end_page(); - # javascript will position the iframe if window was resized (or zoomed) - return < + my $script = Apache::lonhtmlcommon::scripttag(<