--- rat/lonwrapper.pm 2006/04/04 15:11:48 1.22 +++ rat/lonwrapper.pm 2008/12/21 04:49:58 1.28.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.22 2006/04/04 15:11:48 albertel Exp $ +# $Id: lonwrapper.pm,v 1.28.2.1 2008/12/21 04:49:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,7 +32,8 @@ use strict; use Apache::Constants qw(:common); use Apache::lonnet; use Apache::lonxml(); -use Apache::lonmenu; +use Apache::lonenc(); +use Apache::lonmenu(); # ================================================================ Main Handler @@ -64,36 +65,45 @@ sub wrapper { &Apache::loncommon::end_page(); } - my $events='onLoad="'.&Apache::lonmenu::loadevents. - '" onUnload="'.&Apache::lonmenu::unloadevents.'"'; - - my $result = &Apache::lonxml::xmlbegin(). - &Apache::loncommon::head(undef,undef, - {'force_register' => 1}); - + + my %layout = ('border' => 0); if ($env{'environment.remote'} eq 'off') { -# -# This is inline remote -# - $result .= < - - - -ENDDOCUMENTINL + if ($env{'environment.icons'} eq 'iconsonly') { + $layout{'rows'} = "100,*"; + } else { + $layout{'rows'} = "200,*"; + } } else { + $layout{'rows'} = "1,*"; + $topurl = "/adm/rat/empty.html"; + } + + my $start_page = + &Apache::loncommon::start_page(undef,undef, + {'force_register' => 1, + 'frameset' => 1, + 'add_entries' => \%layout, }); + + my $end_page = + &Apache::loncommon::end_page({'frameset' => 1}); + + foreach my $url ($topurl,$bottomurl) { + if ($url !~ /^https?\:/) { + $url = &Apache::lonenc::check_encrypt($url); + } + } # # frame-based rendering for graphical interface # - $result .=< - - - + my $result =< + +$end_page ENDDOCUMENT - } - $result .= "\n\n"; + return $result; } sub handler { @@ -116,7 +126,8 @@ sub handler { $orgurl.=(($orgurl=~/\?/)?'&':'?').'wrapperdisplay=menu'; $url=~s/^\/adm\/wrapper//; my $is_ext = $url =~ m|^/ext/|; - $url=~s/^\/ext\//http\:\/\//; + $url=~s{^/ext/}{http://}; + $url=~s|http://https://|https://|; $url=~s|:|:|g; # # Actual URL