--- loncom/interface/loncommon.pm 2005/05/25 21:45:07 1.261 +++ loncom/interface/loncommon.pm 2005/06/06 20:31:24 1.267 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.261 2005/05/25 21:45:07 albertel Exp $ +# $Id: loncommon.pm,v 1.267 2005/06/06 20:31:24 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -673,7 +673,6 @@ sub help_open_menu { foreach (\$color,\$function,\$topic,\$component_help,\$faq,\$bug,\$origurl) { $$_ = &Apache::lonnet::escape($$_); } - if (!$stayOnPage) { $link = "javascript:helpMenu('open')"; } else { @@ -684,8 +683,8 @@ sub help_open_menu { my $template; if ($text ne "") { $template .= - "". - "
$text"; + "". + "'); $i++; }
$text"; } my $nothing=&Apache::lonhtmlcommon::javascript_nothing(); my $html=&Apache::lonxml::xmlbegin(); @@ -699,7 +698,7 @@ function helpMenu(target) { if (target == 'open') { var newWindow = null; try { - newWindow = window.open("$nothing","helpmenu","HEIGHT=$height,WIDTH=$width,resizable=yes,scrollbars=yes" ) + newWindow = window.open($nothing,"helpmenu","HEIGHT=$height,WIDTH=$width,resizable=yes,scrollbars=yes" ) } catch(error) { writeHelp(caller); @@ -713,9 +712,9 @@ function helpMenu(target) { return; } function writeHelp(caller) { - caller.document.write('$htmlLON-CAPA Help Menu') - caller.document.write("") - caller.document.write("") + caller.document.writeln('$htmlLON-CAPA Help Menu') + caller.document.writeln("") + caller.document.writeln("") caller.document.close() caller.focus() } @@ -2001,8 +2000,6 @@ sub track_student_link { return qq{$linktext}; } - - =pod =back @@ -3264,6 +3261,11 @@ Separate a record into fields $record sh =cut +sub takeleft { + my $index=shift; + return substr('0000'.$index,-4,4); +} + sub record_sep { my $record=shift; my %components=(); @@ -3274,7 +3276,7 @@ sub record_sep { my $field=$_; $field=~s/^(\"|\')//; $field=~s/(\"|\')$//; - $components{$i}=$field; + $components{&takeleft($i)}=$field; $i++; } } elsif ($env{'form.upfiletype'} eq 'tab') { @@ -3283,7 +3285,7 @@ sub record_sep { my $field=$_; $field=~s/^(\"|\')//; $field=~s/(\"|\')$//; - $components{$i}=$field; + $components{&takeleft($i)}=$field; $i++; } } else { @@ -3301,7 +3303,7 @@ sub record_sep { $field=~s/^\s*$delimiter//; $field=~s/$delimiter\s*$//; } - $components{$i}=$field; + $components{&takeleft($i)}=$field; $i++; } } @@ -3458,9 +3460,9 @@ sub csv_samples_select_table { $display.''); } $r->print(''); - if (defined($sone{$_})) { $r->print($sone{$_}."
\n"); } - if (defined($stwo{$_})) { $r->print($stwo{$_}."
\n"); } - if (defined($sthree{$_})) { $r->print($sthree{$_}."
\n"); } + if (defined($sone{$_})) { $r->print($sone{$_}."
\n"); } + if (defined($stwo{$_})) { $r->print($stwo{$_}."
\n"); } + if (defined($sthree{$_})) { $r->print($sthree{$_}."
\n"); } $r->print('