--- loncom/interface/lonsource.pm 2004/06/12 01:08:11 1.1 +++ loncom/interface/lonsource.pm 2004/06/12 04:44:31 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA -# Publication Handler +# Souce Code handler # -# $Id: lonsource.pm,v 1.1 2004/06/12 01:08:11 taceyjo1 Exp $ +# $Id: lonsource.pm,v 1.2 2004/06/12 04:44:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,41 +42,41 @@ use Apache::lonlocal; use HTML::Entities; sub make_link { - my ($filename) = @_; - my $sourcelink = "http://".$ENV{'SERVER_NAME'}."/adm/source/?filename=".$filename; - - -return $sourcelink; - + my ($filename) = @_; + my $sourcelink = "http://".$ENV{'SERVER_NAME'}. + "/adm/source/?filename=".$filename; + + return $sourcelink; } sub stage_2 { - my ($r, $filename) = @_; - $r->print("Comming Soon"); - return OK; + my ($r, $filename) = @_; + $r->print("Coming Soon"); + return OK; } sub print_item { - my ($r, $filename) = @_; - $filename = "/home/httpd/html".$filename; - my $file_output = &Apache::lonnet::getfile($filename); - my ($rows,$cols) = &Apache::edit::textarea_sizes(\$file_output); - $r->print(''); - - return OK; + my ($r, $filename) = @_; + $filename = "/home/httpd/html".$filename; + my $file_output = &Apache::lonnet::getfile($filename); + my ($rows,$cols) = &Apache::edit::textarea_sizes(\$file_output); + $r->print(''); + return OK; } sub handler { - my $r=shift; - if($ENV{'form.action'} eq 'stage2') { - &stage_2($r, $ENV{'form.filename'}); - } else { + my $r=shift; + if($ENV{'form.action'} eq 'stage2') { + &stage_2($r, $ENV{'form.filename'}); + } else { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['filename']); - return FORBIDDEN if !&Apache::lonnet::allowed('cre',$ENV{'form.filename'}) + ['filename']); + if (!&Apache::lonnet::allowed('cre',$ENV{'form.filename'})) { + return FORBIDDEN; + } &Apache::loncommon::content_type($r,'text/html'); my $filename = $ENV{'form.filename'}; $r->send_http_header; @@ -88,12 +88,10 @@ sub handler { '); $r->print('
'); &print_item($r, $ENV{'form.filename'}); - } - return OK; - + } + return OK; } - 1; - \ No newline at end of file +