--- loncom/interface/groupsort.pm 2005/06/10 16:56:08 1.36 +++ loncom/interface/groupsort.pm 2005/06/10 20:43:10 1.37 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.36 2005/06/10 16:56:08 www Exp $ +# $Id: groupsort.pm,v 1.37 2005/06/10 20:43:10 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -227,6 +227,7 @@ sub readfromfile { &Apache::loncommon::plainname($2,$3).', '. &Apache::lonlocal::locallocaltime($1); } + $name=~s/\&colon\;/\:/g; $$thash{$url}=$name; $$shash{$url}=$n; $n++; @@ -253,14 +254,22 @@ sub handler { # finish_import looks different for graphical or "simple" RAT my $finishimport=''; + my $begincondition=''; + my $endcondition=''; + if ($env{'form.readfile'}) { + $begincondition='if (eval("document.forms.groupsort.include"+num+".checked")) {'; + $endcondition='}'; + } if ($env{'form.mode'} eq 'simple' || $env{'form.mode'} eq '') { $finishimport=(< 'Cancel', 'co' => 'Change Order', 'ti' => 'Title', - 'pa' => 'Path' + 'pa' => 'Path', + 'in' => 'Include' ); $r->print(&Apache::loncommon::bodytag('Sort Imported Resources')); $r->print(<print("
"); $r->print("\n"); - $r->print("\n"); + if ($env{'form.readfile'}) { + $r->print("\n"); + } else { + $r->print("\n"); + } $r->print("\n"); $r->print("\n"); } else { @@ -407,13 +423,21 @@ END my $iconname=&Apache::loncommon::icon($key); if ($clen > 1) { $r->print(""); + unless ($env{'form.readfile'}) { + $r->print(""); + } + $r->print("
$lt{'co'}$lt{'in'}$lt{'co'}$lt{'ti'}$lt{'pa'}
"); - $r->print(&movers($clen,$ctr)); + if ($env{'form.readfile'}) { + $r->print(&checkbox($ctr-1)); + } else { + $r->print(&movers($clen,$ctr)); + } } $r->print(&hidden($ctr-1,$thash{$key},$key)); if ($clen > 1) { - $r->print(""); - $r->print(&select_box($clen,$ctr)); - $r->print(""); + $r->print("". + &select_box($clen,$ctr). + ""); $r->print(""); $r->print(""); $r->print("$thash{$key}$nhash{$key}\n"); @@ -484,6 +508,15 @@ sub select_box { return $string; } +# ------------------------------------------------------------------- Checkbox + +sub checkbox { + my $sel=shift; + return "'; +} + 1; __END__