version 1.6, 2001/12/04 15:34:57
|
version 1.20, 2003/11/19 14:57:32
|
Line 36
|
Line 36
|
# |
# |
# 11/22,11/23,11/28, |
# 11/22,11/23,11/28, |
# 03/30/01 Gerd Kortemeyer |
# 03/30/01 Gerd Kortemeyer |
|
|
package Apache::lonconstruct; |
package Apache::lonconstruct; |
|
|
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http :methods); |
|
use Apache::lonnet; |
|
use Apache::Log (); |
|
use HTML::Entities(); |
|
|
|
my $DEBUG = 0; |
|
=pod |
|
|
|
=item Debug($request, $message) |
|
|
|
If debugging is enabled puts out a debuggin message determined by the |
|
caller. The debug message goes to the Apache error log file. Debugging |
|
is enabled by ssetting the module global DEBUG variable to nonzero (TRUE). |
|
|
|
Parameters: |
|
|
|
=over 4 |
|
|
|
=item $request - The curretn request operation. |
|
|
|
=item $message - The message to put inthe log file. |
|
|
|
=back |
|
|
|
Returns: |
|
nothing. |
|
|
|
=cut |
|
|
|
sub Debug { |
|
|
|
# Marshall the parameters. |
|
|
|
my $r = shift; |
|
my $log = $r->log; |
|
my $message = shift; |
|
|
|
# Put out the indicated message butonly if DEBUG is false. |
|
|
|
if ($DEBUG) { |
|
$log->debug($message); |
|
} |
|
} |
|
|
|
|
|
|
|
|
# ================================================================ Main Handler |
# ================================================================ Main Handler |
|
|
Line 54 sub handler {
|
Line 99 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
my $lowerframe=$r->path_info; |
my $lowerframe=$r->path_info; |
|
&Debug($r, "Initial URL for lower frame: ".$lowerframe); |
$lowerframe=~s/^\//\/\~/; |
$lowerframe=~s/^\//\/\~/; |
|
&Debug($r, "Lower frame URL afer ~ subst: ".$lowerframe); |
|
$lowerframe= &HTML::Entities::encode($lowerframe); |
|
&Debug($r, "Lower frame URL after quote subst: ".$lowerframe); |
|
|
|
# |
|
# Are we forcing edit mode? |
|
# |
|
|
|
&Apache::loncommon::get_unprocessed_cgi |
|
($ENV{'QUERY_STRING'},['forceedit']); |
|
if ($ENV{'form.forceedit'}) { |
|
$lowerframe.='?editmode=Edit&problemmode=EditXML'; |
|
} |
|
&Apache::loncommon::get_unprocessed_cgi |
|
($ENV{'QUERY_STRING'},['forceColoredit']); |
|
if ($ENV{'form.forceColoredit'}) { |
|
$lowerframe.='?editmode=Edit&problemmode=Edit'; |
|
} |
$r->print(<<ENDPAGE); |
$r->print(<<ENDPAGE); |
<html> |
<html> |
<head><title>LON-CAPA Construction Space</title></head> |
<head><title>LON-CAPA Construction Space</title> |
<frameset rows="110,*"> |
<script language="JavaScript"> |
|
var lastknownpriv="$lowerframe"; |
|
</script> |
|
</head> |
|
<frameset rows="110,*" border="0"> |
<frame src='/adm/publisher.html'> |
<frame src='/adm/publisher.html'> |
<frame src='$lowerframe' name="LONCAPAToBePublished"> |
<frame src="$lowerframe" name="LONCAPAToBePublished"> |
</frameset> |
</frameset> |
</html> |
</html> |
ENDPAGE |
ENDPAGE |