[LON-CAPA-cvs] cvs: rat / lonwrapper.pm
www
lon-capa-cvs@mail.lon-capa.org
Tue, 15 Apr 2003 03:53:03 -0000
www Mon Apr 14 23:53:03 2003 EDT
Modified files:
/rat lonwrapper.pm
Log:
Attempt to do the inline remote for "wrapped" pages without doing ssi.
Index: rat/lonwrapper.pm
diff -u rat/lonwrapper.pm:1.11 rat/lonwrapper.pm:1.12
--- rat/lonwrapper.pm:1.11 Fri Feb 28 22:06:37 2003
+++ rat/lonwrapper.pm Mon Apr 14 23:53:03 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Wrapper for external and binary files as standalone resources
#
-# $Id: lonwrapper.pm,v 1.11 2003/03/01 03:06:37 www Exp $
+# $Id: lonwrapper.pm,v 1.12 2003/04/15 03:53:03 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -50,21 +50,59 @@
return OK if $r->header_only;
- my $url=$r->uri;
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['wrapperdisplay']);
+ my $orgurl=$r->uri;
+ my $url=$orgurl;
$url=~s/^\/adm\/wrapper//;
$url=~s/^\/ext\//http\:\/\//;
- if ($url=~/^\/uploaded\//) {
- $url=&Apache::lonnet::tokenwrapper($url);
- }
- $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'}; #reappend the query arguments
- my $events='onLoad="'.&Apache::lonmenu::loadevents.
- '" onUnload="'.&Apache::lonmenu::unloadevents.'"';
- my $script=&Apache::lonmenu::registerurl(1,undef);
- unless ($ENV{'browser.interface'} eq 'textual') {
+ if ($ENV{'form.wrapperdisplay'} eq 'menu') {
+#
+# Producing the menu buttons
+#
+ $r->print('<html><body bgcolor="#FFFFFF">'.
+ &Apache::lonmenu::menubuttons(1,'web',1).'</body></html>');
+ } else {
+#
+# Actual URL
+#
+ if ($url=~/^\/uploaded\//) {
+ $url=&Apache::lonnet::tokenwrapper($url);
+ }
+ $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'}; #reappend the query arguments
+ my $events='onLoad="'.&Apache::lonmenu::loadevents.
+ '" onUnload="'.&Apache::lonmenu::unloadevents.'"';
+ my $script=&Apache::lonmenu::registerurl(1,undef);
+
+ if ($ENV{'browser.interface'} eq 'textual') {
+#
+# ssi-based rendering for text-based interface
+#
+ $r->print('<html><head>'.
+ &Apache::lonmenu::registerurl(1).
+ '</head><body bgcolor="#FFFFFF">'.
+ &Apache::lonmenu::menubuttons(1).
+ &Apache::lonnet::ssi_body($url).'</body></html>');
+ } elsif ($ENV{'environment.remote'} eq 'off') {
+#
+# This is inline remote
+#
+ $r->print(<<ENDDOCUMENTINL);
+<html>
+<head>
+$script
+</head>
+<frameset rows="180,*" border=0 $events>
+<frame src="$orgurl?wrapperdisplay=menu">
+<frame src="$url">
+</frameset>
+</html>
+ENDDOCUMENTINL
+ } else {
#
# frame-based rendering for graphical interface
#
- $r->print(<<ENDDOCUMENT);
+ $r->print(<<ENDDOCUMENT);
<html>
<head>
$script
@@ -75,15 +113,7 @@
</frameset>
</html>
ENDDOCUMENT
- } else {
-#
-# ssi-based rendering for text-based interface
-#
- $r->print('<html><head>'.
- &Apache::lonmenu::registerurl(1).
- '</head><body bgcolor="#FFFFFF">'.
- &Apache::lonmenu::menubuttons(1).
- &Apache::lonnet::ssi_body($url).'</body></html>');
+ }
}
return OK;
}