[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 30 May 2005 19:50:46 -0000
www Mon May 30 15:50:46 2005 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
Replaced keys in cvs upload by 0001, 0002, ..., 0013 to avoid "random" ordering.
Replaced the all-new </br>-tag by good-old <br /> - works better.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.262 loncom/interface/loncommon.pm:1.263
--- loncom/interface/loncommon.pm:1.262 Thu May 26 16:49:23 2005
+++ loncom/interface/loncommon.pm Mon May 30 15:50:43 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.262 2005/05/26 20:49:23 albertel Exp $
+# $Id: loncommon.pm,v 1.263 2005/05/30 19:50:43 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3264,6 +3264,11 @@
=cut
+sub takeleft {
+ my $index=shift;
+ return substr('0000'.$index,-4,4);
+}
+
sub record_sep {
my $record=shift;
my %components=();
@@ -3274,7 +3279,7 @@
my $field=$_;
$field=~s/^(\"|\')//;
$field=~s/(\"|\')$//;
- $components{$i}=$field;
+ $components{&takeleft($i)}=$field;
$i++;
}
} elsif ($env{'form.upfiletype'} eq 'tab') {
@@ -3283,7 +3288,7 @@
my $field=$_;
$field=~s/^(\"|\')//;
$field=~s/(\"|\')$//;
- $components{$i}=$field;
+ $components{&takeleft($i)}=$field;
$i++;
}
} else {
@@ -3301,7 +3306,7 @@
$field=~s/^\s*$delimiter//;
$field=~s/$delimiter\s*$//;
}
- $components{$i}=$field;
+ $components{&takeleft($i)}=$field;
$i++;
}
}
@@ -3458,9 +3463,9 @@
$display.'</option>');
}
$r->print('</select></td><td>');
- if (defined($sone{$_})) { $r->print($sone{$_}."</br>\n"); }
- if (defined($stwo{$_})) { $r->print($stwo{$_}."</br>\n"); }
- if (defined($sthree{$_})) { $r->print($sthree{$_}."</br>\n"); }
+ if (defined($sone{$_})) { $r->print($sone{$_}."<br />\n"); }
+ if (defined($stwo{$_})) { $r->print($stwo{$_}."<br />\n"); }
+ if (defined($sthree{$_})) { $r->print($sthree{$_}."<br />\n"); }
$r->print('</td></tr>');
$i++;
}