[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 17 Jul 2007 18:07:20 -0000


albertel		Tue Jul 17 14:07:20 2007 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - BUG#5325, sort domain case insensitive
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.549 loncom/interface/loncommon.pm:1.550
--- loncom/interface/loncommon.pm:1.549	Wed Jul 11 16:37:52 2007
+++ loncom/interface/loncommon.pm	Tue Jul 17 14:07:18 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.549 2007/07/11 20:37:52 albertel Exp $
+# $Id: loncommon.pm,v 1.550 2007/07/17 18:07:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1263,8 +1263,10 @@
     } &Apache::lonnet::all_domains();
     if ($multiple) {
 	$domains{''}=&mt('Any domain');
+	$domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];
 	return &multiple_select_form($name,$value,4,\%domains);
     } else {
+	$domains{'select_form_order'} = [sort {lc($a) cmp lc($b) } (keys(%domains))];
 	return &select_form($name,$value,%domains);
     }
 }
@@ -1430,7 +1432,7 @@
 #-------------------------------------------
 sub select_dom_form {
     my ($defdom,$name,$includeempty) = @_;
-    my @domains = sort(&Apache::lonnet::all_domains());
+    my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
     if ($includeempty) { @domains=('',@domains); }
     my $selectdomain = "<select name=\"$name\" size=\"1\">\n";
     foreach my $dom (@domains) {