[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm lonsource.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sat, 12 Jun 2004 04:44:32 -0000
albertel Sat Jun 12 00:44:32 2004 EDT
Modified files:
/loncom/interface lonsource.pm lonindexer.pm
Log:
- style police
- spelling police
- trailing if police
- The Police Never Go On Vacation
:-)
Index: loncom/interface/lonsource.pm
diff -u loncom/interface/lonsource.pm:1.1 loncom/interface/lonsource.pm:1.2
--- loncom/interface/lonsource.pm:1.1 Fri Jun 11 21:08:11 2004
+++ loncom/interface/lonsource.pm Sat Jun 12 00:44:31 2004
@@ -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 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('<textarea rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'.
- &HTML::Entities::encode($file_output,'<>&"').'</textarea>');
-
- 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('<textarea rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'.
+ &HTML::Entities::encode($file_output,'<>&"').'</textarea>');
+ 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 @@
</form>');
$r->print('<hr />');
&print_item($r, $ENV{'form.filename'});
- }
- return OK;
-
+ }
+ return OK;
}
-
1;
-
\ No newline at end of file
+
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.109 loncom/interface/lonindexer.pm:1.110
--- loncom/interface/lonindexer.pm:1.109 Fri Jun 11 21:08:11 2004
+++ loncom/interface/lonindexer.pm Sat Jun 12 00:44:31 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.109 2004/06/12 01:08:11 taceyjo1 Exp $
+# $Id: lonindexer.pm,v 1.110 2004/06/12 04:44:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1010,14 +1010,14 @@
}
if ($hash{'display_attrs_10'} == 1) {
my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
- if($source eq 'open') {
- my $sourcelink = &Apache::lonsource::make_link($filelink);
- $r->print('<td>'."<a href=\"javascript:openWindow('".$sourcelink.
- "', 'previewsource', '700', '700', 'no', 'yes','yes')\";".
- " TARGET=_self>Yes</a> "."</td>\n");
- } else { #A cuddled else. :P
- $r->print('<td>'."</td>\n");
- }
+ if($source eq 'open') {
+ my $sourcelink = &Apache::lonsource::make_link($filelink);
+ $r->print('<td>'."<a href=\"javascript:openWindow('".$sourcelink.
+ "', 'previewsource', '700', '700', 'no', 'yes','yes')\";".
+ " TARGET=_self>Yes</a> "."</td>\n");
+ } else { #A cuddled else. :P
+ $r->print('<td>'."</td>\n");
+ }
}
$r->print("</tr>\n");
}