version 1.9, 2003/02/20 19:41:26
|
version 1.13, 2003/05/13 15:13:17
|
Line 50 sub handler {
|
Line 50 sub handler {
|
|
|
return OK if $r->header_only; |
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/^\/adm\/wrapper//; |
$url=~s/^\/ext\//http\:\/\//; |
$url=~s/^\/ext\//http\:\/\//; |
if ($url=~/^\/uploaded\//) { |
if ($ENV{'form.wrapperdisplay'} eq 'menu') { |
$url=&Apache::lonnet::tokenwrapper($url); |
# |
} |
# Producing the menu buttons |
$url.='?'.$ENV{'QUERY_STRING'}; #reappend the query arguments |
# |
my $events='onLoad="'.&Apache::lonmenu::loadevents. |
$r->print('<html><body bgcolor="#FFFFFF">'. |
'" onUnload="'.&Apache::lonmenu::unloadevents.'"'; |
&Apache::lonmenu::menubuttons(1,'web',1).'</body></html>'); |
my $script=&Apache::lonmenu::registerurl(1,undef); |
} else { |
unless ($ENV{'browser.interface'} eq 'textual') { |
# |
|
# Actual URL |
|
# |
|
if ($url=~/\.(problem|exam|quiz|assess|survey|form|library)$/) { |
|
# |
|
# This is uploaded homework |
|
# |
|
$ENV{'request.state'}='uploaded'; |
|
&Apache::lonhomework::renderpage($r,$url); |
|
} else { |
|
# |
|
# This is not homework |
|
# |
|
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 |
# frame-based rendering for graphical interface |
# |
# |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
<head> |
<head> |
$script |
$script |
Line 75 $script
|
Line 124 $script
|
</frameset> |
</frameset> |
</html> |
</html> |
ENDDOCUMENT |
ENDDOCUMENT |
} else { |
} |
# |
} # not homework |
# ssi-based rendering for text-based interface |
} # not just the menu |
# |
|
$r->print('<html><head>'. |
|
&Apache::lonmenu::registerurl(1). |
|
'</head>'. |
|
&Apache::loncommon::bodytag(). |
|
&Apache::lonmenu::menubuttons(1). |
|
&Apache::lonnet::ssi_body($url).'</body></html>'); |
|
} |
|
return OK; |
return OK; |
} |
} # handler |
|
|
1; |
1; |
__END__ |
__END__ |