--- loncom/interface/groupsort.pm 2005/06/10 15:17:35 1.35 +++ loncom/interface/groupsort.pm 2006/02/07 19:46:30 1.39 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.35 2005/06/10 15:17:35 www Exp $ +# $Id: groupsort.pm,v 1.39 2006/02/07 19:46:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -195,6 +195,7 @@ sub cleanup { &Apache::lonnet::logthis('Failed cleanup groupsort: hash'); } } + return OK; } # -------------------------------------------------------------- Read from file @@ -227,6 +228,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 +255,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=(< 'Finalize order of resources', 'gb' => 'Go Back', @@ -349,7 +361,8 @@ END 'ca' => 'Cancel', 'co' => 'Change Order', 'ti' => 'Title', - 'pa' => 'Path' + 'pa' => 'Path', + 'in' => 'Include' ); $r->print(&Apache::loncommon::bodytag('Sort Imported Resources')); $r->print(< + + END # --- Expand here if "GO BACK" button desired @@ -385,7 +400,11 @@ END END $r->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 { @@ -403,22 +422,30 @@ END my $key=$_; $ctr++; my $iconname=&Apache::loncommon::icon($key); - if ($clen > 1) { + if (($clen > 1) || ($env{'form.readfile'})) { $r->print(""); + unless ($env{'form.readfile'}) { + $r->print(""); + } + $r->print("\n"); } } - if ($clen > 1) { + if (($clen > 1) || ($env{'form.readfile'})) { $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(""); + if (($clen > 1) || ($env{'form.readfile'})) { + $r->print("". + &select_box($clen,$ctr). + ""); $r->print(""); $r->print(""); - $r->print("$thash{$key}\n"); + $r->print("$thash{$key}$nhash{$key}\n"); $r->print("$key
"); } else { $r->print(<"; for my $cur (1..$total) { $string .= "