version 1.1, 2004/06/12 01:08:11
|
version 1.2, 2004/06/12 04:44:31
|
Line 1
|
Line 1
|
# The LearningOnline Network with CAPA |
# The LearningOnline Network with CAPA |
# Publication Handler |
# Souce Code handler |
# |
# |
# $Id$ |
# $Id$ |
# |
# |
Line 42 use Apache::lonlocal;
|
Line 42 use Apache::lonlocal;
|
use HTML::Entities; |
use HTML::Entities; |
|
|
sub make_link { |
sub make_link { |
my ($filename) = @_; |
my ($filename) = @_; |
my $sourcelink = "http://".$ENV{'SERVER_NAME'}."/adm/source/?filename=".$filename; |
my $sourcelink = "http://".$ENV{'SERVER_NAME'}. |
|
"/adm/source/?filename=".$filename; |
|
|
return $sourcelink; |
return $sourcelink; |
|
|
} |
} |
|
|
sub stage_2 { |
sub stage_2 { |
my ($r, $filename) = @_; |
my ($r, $filename) = @_; |
$r->print("Comming Soon"); |
$r->print("Coming Soon"); |
return OK; |
return OK; |
} |
} |
|
|
sub print_item { |
sub print_item { |
my ($r, $filename) = @_; |
my ($r, $filename) = @_; |
$filename = "/home/httpd/html".$filename; |
$filename = "/home/httpd/html".$filename; |
my $file_output = &Apache::lonnet::getfile($filename); |
my $file_output = &Apache::lonnet::getfile($filename); |
my ($rows,$cols) = &Apache::edit::textarea_sizes(\$file_output); |
my ($rows,$cols) = &Apache::edit::textarea_sizes(\$file_output); |
$r->print('<textarea rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'. |
$r->print('<textarea rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'. |
&HTML::Entities::encode($file_output,'<>&"').'</textarea>'); |
&HTML::Entities::encode($file_output,'<>&"').'</textarea>'); |
|
return OK; |
return OK; |
|
|
|
} |
} |
|
|
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
if($ENV{'form.action'} eq 'stage2') { |
if($ENV{'form.action'} eq 'stage2') { |
&stage_2($r, $ENV{'form.filename'}); |
&stage_2($r, $ENV{'form.filename'}); |
} else { |
} else { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['filename']); |
['filename']); |
return FORBIDDEN if !&Apache::lonnet::allowed('cre',$ENV{'form.filename'}) |
if (!&Apache::lonnet::allowed('cre',$ENV{'form.filename'})) { |
|
return FORBIDDEN; |
|
} |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
my $filename = $ENV{'form.filename'}; |
my $filename = $ENV{'form.filename'}; |
$r->send_http_header; |
$r->send_http_header; |
Line 88 sub handler {
|
Line 88 sub handler {
|
</form>'); |
</form>'); |
$r->print('<hr />'); |
$r->print('<hr />'); |
&print_item($r, $ENV{'form.filename'}); |
&print_item($r, $ENV{'form.filename'}); |
} |
} |
return OK; |
return OK; |
|
|
} |
} |
|
|
|
|
1; |
1; |
|
|
|
|
|
|
|
|