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

raeburn raeburn at source.lon-capa.org
Sat Apr 12 20:42:07 EDT 2014


raeburn		Sun Apr 13 00:42:07 2014 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - prepend # before storing text and background color defaults for domain.
  - lower case text and background color choices. 
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.233 loncom/interface/domainprefs.pm:1.234
--- loncom/interface/domainprefs.pm:1.233	Wed Apr  2 16:27:18 2014
+++ loncom/interface/domainprefs.pm	Sun Apr 13 00:42:06 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.233 2014/04/02 16:27:18 raeburn Exp $
+# $Id: domainprefs.pm,v 1.234 2014/04/13 00:42:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1472,7 +1472,7 @@
     $datatable .= '<td class="LC_right_item">'.
                   '<table border="0"><tr>';
     foreach my $item (@{$links}) {
-	my $color = $designs->{'link'}{$item} ? $designs->{'link'}{$item} : $defaults->{'links'}{$item};
+	my $color = $designs->{'links'}{$item} ? $designs->{'links'}{$item} : $defaults->{'links'}{$item};
         $datatable .= '<td align="center">'.$choices->{$item}."\n";
         if ($designs->{'links'}{$item}) {
             $datatable.=' ';
@@ -5769,22 +5769,38 @@
         }
         if ($role eq 'login') {
             foreach my $item (@logintext) {
-                unless ($env{'form.'.$role.'_'.$item} eq  $defaults{'logintext'}{$item}) {
+                $env{'form.'.$role.'_'.$item} = lc($env{'form.'.$role.'_'.$item});
+                if ($env{'form.'.$role.'_'.$item} =~ /^\w+/) {
+                    $env{'form.'.$role.'_'.$item} = '#'.$env{'form.'.$role.'_'.$item};
+                }
+                unless ($env{'form.'.$role.'_'.$item} eq lc($defaults{'logintext'}{$item})) {
                     $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
                 }
             }
         } else {
-            unless($env{'form.'.$role.'_fontmenu'} eq $defaults{'fontmenu'}) {
+            $env{'form.'.$role.'_fontmenu'} = lc($env{'form.'.$role.'_fontmenu'});
+            if ($env{'form.'.$role.'_fontmenu'} =~ /^\w+/) {
+                $env{'form.'.$role.'_fontmenu'} = '#'.$env{'form.'.$role.'_fontmenu'};
+            }
+            unless($env{'form.'.$role.'_fontmenu'} eq lc($defaults{'fontmenu'})) {
                 $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
             }
         }
         foreach my $item (@bgs) {
-            unless ($env{'form.'.$role.'_'.$item} eq $defaults{'bgs'}{$item} ) {
+            $env{'form.'.$role.'_'.$item} = lc($env{'form.'.$role.'_'.$item});
+            if ($env{'form.'.$role.'_'.$item} =~ /^\w+/) {
+                $env{'form.'.$role.'_'.$item} = '#'.$env{'form.'.$role.'_'.$item};
+            }
+            unless ($env{'form.'.$role.'_'.$item} eq lc($defaults{'bgs'}{$item})) {
                 $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
             }
         }
         foreach my $item (@links) {
-            unless ($env{'form.'.$role.'_'.$item} eq  $defaults{'links'}{$item}) {
+            $env{'form.'.$role.'_'.$item} = lc($env{'form.'.$role.'_'.$item});
+            if ($env{'form.'.$role.'_'.$item} =~ /^\w+/) {
+                $env{'form.'.$role.'_'.$item} = '#'.$env{'form.'.$role.'_'.$item};
+            }
+            unless ($env{'form.'.$role.'_'.$item} eq lc($defaults{'links'}{$item})) {
                 $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
             }
         }




More information about the LON-CAPA-cvs mailing list