[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 17 Jun 2005 16:40:31 -0000
albertel Fri Jun 17 12:40:31 2005 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- added a <label>
- some style cleanups
- some xhtml cleanups
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.189 loncom/interface/londocs.pm:1.190
--- loncom/interface/londocs.pm:1.189 Mon Jun 13 16:23:53 2005
+++ loncom/interface/londocs.pm Fri Jun 17 12:40:28 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.189 2005/06/13 20:23:53 albertel Exp $
+# $Id: londocs.pm,v 1.190 2005/06/17 16:40:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1178,7 +1178,7 @@
my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase) = @_;
# upload a file, if present
my $parseaction;
- if ($env{'form.parserflag'}) {
+ if ($env{'form.parserflag'}) {
$parseaction = 'parse';
}
my $phase_status;
@@ -1212,7 +1212,9 @@
# probably the only place in the system where this should be "1"
my $newidx=&Apache::lonratedt::getresidx();
$destination .= $newidx;
- my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination,$parseaction,$allfiles,$codebase);
+ my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination,
+ $parseaction,$allfiles,
+ $codebase);
my $ext='false';
if ($url=~/^http\:\/\//) { $ext='true'; }
$url=~s/\:/\:/g;
@@ -1227,15 +1229,15 @@
$Apache::lonratedt::resources[$newidx]=
$comment.':'.$url.':'.$ext.':normal:res';
- $Apache::lonratedt::order[$#Apache::lonratedt::order+1]=
- $newidx;
- ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
+ $Apache::lonratedt::order[$#Apache::lonratedt::order+1]= $newidx;
+ ($errtext,$fatal)=&storemap($coursenum,$coursedom,
+ $folder.'.'.$container);
if ($fatal) {
$$upload_output .= '<p><font color="red">'.$errtext.'</font></p>';
return 'failed';
} else {
if ($parseaction eq 'parse') {
- my $total_embedded = keys %{$allfiles};
+ my $total_embedded = keys(%{$allfiles});
if ($total_embedded > 0) {
my $num = 0;
$$upload_output .= 'This file contains embedded multimedia objects, which need to be uploaded to LON-CAPA.<br />
@@ -1247,10 +1249,10 @@
<input type="hidden" name="phasetwo" value="'.$total_embedded.'" />';
$$upload_output .= '<b>Upload embedded files</b>:<br />
<table>';
- foreach my $embed_file (keys %{$allfiles}) {
+ foreach my $embed_file (keys(%{$allfiles})) {
$$upload_output .= '<tr><td>'.$embed_file.
- '<input name="embedded_item_'.$num.'" type="file">
- <input name="embedded_orig_'.$num.'" type="hidden" value="'.&Apache::lonnet::escape($embed_file).'"/>';
+ '<input name="embedded_item_'.$num.'" type="file" />
+ <input name="embedded_orig_'.$num.'" type="hidden" value="'.&Apache::lonnet::escape($embed_file).'" />';
my $attrib;
if (@{$$allfiles{$embed_file}} > 1) {
$attrib = join(':',@{$$allfiles{$embed_file}});
@@ -2242,7 +2244,9 @@
if ($allowed) {
if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) {
# Process file upload - phase one - upload and parse primary file.
- $upload_result = &process_file_upload(\$upload_output,$coursenum,$coursedom,\%allfiles,\%codebase);
+ $upload_result = &process_file_upload(\$upload_output,$coursenum,
+ $coursedom,\%allfiles,
+ \%codebase);
if ($upload_result eq 'phasetwo') {
$r->print($upload_output);
}
@@ -2445,8 +2449,9 @@
<input type="hidden" name="cmd" value="upload_default">
<br />
<nobr>
-$lt{'parse'}?
+<label>$lt{'parse'}?
<input type="checkbox" name="parserflag" />
+</label>
</nobr>
<br />
<br />