--- loncom/interface/groupsort.pm 2003/06/14 00:15:01 1.21 +++ loncom/interface/groupsort.pm 2003/08/26 05:44:11 1.22 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.21 2003/06/14 00:15:01 albertel Exp $ +# $Id: groupsort.pm,v 1.22 2003/08/26 05:44:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -139,7 +139,6 @@ function orderchange(val,newval) { END - $r->print(&Apache::loncommon::bodytag('Sort Imported Resources')); # read pertinent machine configuration my $domain = $r->dir_config('lonDefDomain'); $iconpath = $r->dir_config('lonIconsURL') . "/"; @@ -290,7 +289,9 @@ END untie %hash; my $ctr = 0; my $clen = scalar(keys %shash); - $r->print(< 1) { + $r->print(&Apache::loncommon::bodytag('Sort Imported Resources')); + $r->print(<Finalize order of resources
@@ -300,32 +301,42 @@ END END -# --- Expand here if "GO BACK" button desired - if ($ENV{'form.catalogmode'} eq 'groupimport') { - $r->print(<print(<  END - } - if ($ENV{'form.catalogmode'} eq 'groupsearch') { - $r->print(<print(<  END - } -# --- + } + # --- - $r->print(<print(<  END - $r->print("\n"); + } + } + if ($clen > 1) { + $r->print("
"); - $r->print("\n"); - $r->print("". - "\n"); - $r->print("\n"); - $r->print("\n"); + $r->print("
Change orderTitlePath
"); + $r->print("\n"); + $r->print("\n"); + $r->print("\n"); + $r->print("\n"); + } else { + $r->print(< + + + + + +END + } foreach (sort {$shash{$a}<=>$shash{$b}} (keys %shash)) { my $key=$_; $ctr++; @@ -336,22 +347,35 @@ END # The unless conditional that follows is a bit of overkill $iconname = $curfext.".gif" unless (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn'); - $r->print("\n"); - } - $r->print("
Change orderTitlePath
"); - $r->print(&movers($clen,$ctr)); + if ($clen > 1) { + $r->print("
"); + $r->print(&movers($clen,$ctr)); + } $r->print(&hidden($ctr-1,$thash{$key},$key)); - $r->print(""); - $r->print(&select_box($clen,$ctr)); - $r->print(""); - $r->print(""); - $r->print(""); - $r->print("$thash{$key}\n"); - $r->print("$key
"); + if ($clen > 1) { + $r->print("
"); + $r->print(&select_box($clen,$ctr)); + $r->print(""); + $r->print(""); + $r->print(""); + $r->print("$thash{$key}\n"); + $r->print("$key
"); + } else { + $r->print(< + finish_import(); + +END + } $r->print(< END + return OK; }