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

raeburn raeburn@source.lon-capa.org
Mon, 06 Dec 2010 17:50:08 -0000


raeburn		Mon Dec  6 12:50:08 2010 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - Customization for GCI_3.
    - Language codes need to be three characters or less.
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.123.2.3 loncom/interface/domainprefs.pm:1.123.2.4
--- loncom/interface/domainprefs.pm:1.123.2.3   Sun Dec  5 21:56:38 2010
+++ loncom/interface/domainprefs.pm     Mon Dec  6 17:50:40 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.123.2.3 2010/12/05 21:56:38 raeburn Exp $
+# $Id: domainprefs.pm,v 1.123.2.4 2010/12/06 17:50:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5440,10 +5440,10 @@
     my @doms = &Apache::lonnet::current_machine_domains();
     my @langs;
     foreach my $dom (@doms) {
-        if ($dom =~ /^(\w+c)itest$/) {
+        if ($dom =~ /^(\w{2})\w?itest$/) {
             push (@langs,$1.'t');
-        } else {
-            push(@langs,$dom);
+        } elsif ($dom =~ /^(\w{2})\w?i$/) {
+            push(@langs,$1.'i');
         }
     }
     foreach my $item (@items) {
@@ -5458,7 +5458,7 @@
             if ($newvalues{$item} ne '') {
                 if ($newvalues{$item} =~ /^(\w+)/) {
                     my $langcode = $1;
-                    if ((!grep(/^\Q$langcode\E,@langs)) &&  
+                    if ((!grep(/^\Q$langcode\E/,@langs)) &&  
                         ($langcode ne 'x_chef')) {
                         if (code2language($langcode) eq '') {
                             push(@errors,$item);