--- rat/lonwrapper.pm 2006/02/10 21:44:02 1.19 +++ rat/lonwrapper.pm 2012/11/27 23:45:15 1.42 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.19 2006/02/10 21:44:02 albertel Exp $ +# $Id: lonwrapper.pm,v 1.42 2012/11/27 23:45:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,110 +26,188 @@ # http://www.lon-capa.org/ # + package Apache::lonwrapper; use strict; use Apache::Constants qw(:common); +use Apache::lonenc(); use Apache::lonnet; -use Apache::lonxml(); -use Apache::lonmenu; +use Apache::lonlocal; +use Apache::loncommon(); +use Apache::lonhtmlcommon(); +use Apache::lonextresedit(); # ================================================================ Main Handler +sub wrapper { + my ($url,$brcrum) = @_; + + 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; + } + + my $startpage = Apache::loncommon::start_page('Menu',undef,$args); + my $endpage = Apache::loncommon::end_page(); + + my $script = Apache::lonhtmlcommon::scripttag(<