--- rat/lonwrapper.pm 2009/10/21 23:47:11 1.36
+++ rat/lonwrapper.pm 2013/09/07 19:58:08 1.44
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Wrapper for external and binary files as standalone resources
#
-# $Id: lonwrapper.pm,v 1.36 2009/10/21 23:47:11 raeburn Exp $
+# $Id: lonwrapper.pm,v 1.44 2013/09/07 19:58:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,66 +31,71 @@ package Apache::lonwrapper;
use strict;
use Apache::Constants qw(:common);
-use Apache::lonnet;
-use Apache::lonxml();
use Apache::lonenc();
-use Apache::lonmenu();
+use Apache::lonnet;
+use Apache::lonlocal;
+use Apache::loncommon();
+use Apache::lonhtmlcommon();
+use Apache::lonextresedit();
# ================================================================ Main Handler
-
-sub simple_menu {
-#
-# Producing the menu buttons
-#
- return &Apache::loncommon::start_page('Menu',undef,
- {'only_body' => 1,
- 'bgcolor' => '#FFFFFF',}).
- &Apache::lonmenu::menubuttons(1,'web',1).
- &Apache::loncommon::end_page();
-}
-
-
sub wrapper {
- my ($topurl,$bottomurl) = @_;
+ my ($url,$brcrum,$absolute) = @_;
- my %layout = ('border' => 0);
- if ($env{'environment.remote'} eq 'off') {
- if ($env{'environment.icons'} eq 'iconsonly') {
- $layout{'rows'} = "140,*";
- } else {
- $layout{'rows'} = "220,*";
- }
- } else {
- $layout{'rows'} = "1,*";
- $topurl = "/adm/rat/empty.html";
+ my $forcereg;
+ unless ($env{'form.folderpath'}) {
+ $forcereg = 1;
}
- my $start_page =
- &Apache::loncommon::start_page(undef,undef,
- {'force_register' => 1,
- 'frameset' => 1,
- 'add_entries' => \%layout, });
+ 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 $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
-#
- my $result =<
-
-$end_page
-ENDDOCUMENT
+ my $startpage = Apache::loncommon::start_page('Menu',undef,$args);
+ my $endpage = Apache::loncommon::end_page();
- return $result;
+ my $script = Apache::lonhtmlcommon::scripttag(<