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

raeburn raeburn@source.lon-capa.org
Sat, 22 Aug 2009 20:28:29 -0000


raeburn		Sat Aug 22 20:28:29 2009 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  -  top level menu font color (introduced in rev 1.97) is not a setting for the log-in page.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.106 loncom/interface/domainprefs.pm:1.107
--- loncom/interface/domainprefs.pm:1.106	Sat Aug 22 18:48:56 2009
+++ loncom/interface/domainprefs.pm	Sat Aug 22 20:28:29 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.106 2009/08/22 18:48:56 raeburn Exp $
+# $Id: domainprefs.pm,v 1.107 2009/08/22 20:28:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -849,20 +849,22 @@
                   '&nbsp;<span id="css_'.$role.'_font" style="background-color: '.
                   $designs->{'font'}.';">&nbsp;&nbsp;&nbsp;</span>'.
                   '</span></td></tr>';
-    $datatable .= '<tr'.$css_class.'>'.
-        '<td>'.$choices->{'fontmenu'}.'</td>';
-    if (!$is_custom->{'fontmenu'}) {
-        $datatable .=  '<td>'.&mt('Default in use:').'&nbsp;<span id="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
-    } else {
-        $datatable .= '<td>&nbsp;</td>';
+    unless ($role eq 'login') { 
+        $datatable .= '<tr'.$css_class.'>'.
+                      '<td>'.$choices->{'fontmenu'}.'</td>';
+        if (!$is_custom->{'fontmenu'}) {
+            $datatable .=  '<td>'.&mt('Default in use:').'&nbsp;<span id="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
+        } else {
+            $datatable .= '<td>&nbsp;</td>';
+        }
+        $fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'});
+        $datatable .= '<td><span class="LC_nobreak">'.
+                      '<input type="text" size="10" name="'.$role.'_fontmenu"'.
+                      ' value="'.$designs->{'fontmenu'}.'" />&nbsp;'.$fontlink.
+                      '&nbsp;<span id="css_'.$role.'_fontmenu" style="background-color: '.
+                      $designs->{'fontmenu'}.';">&nbsp;&nbsp;&nbsp;</span>'.
+                      '</span></td></tr>';
     }
-    $fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'});
-    $datatable .= '<td><span class="LC_nobreak">'.
-                  '<input type="text" size="10" name="'.$role.'_fontmenu"'.
-                  ' value="'.$designs->{'fontmenu'}.'" />&nbsp;'.$fontlink.
-                  '&nbsp;<span id="css_'.$role.'_fontmenu" style="background-color: '.
-                  $designs->{'fontmenu'}.';">&nbsp;&nbsp;&nbsp;</span>'.
-                  '</span></td></tr>';
     my $switchserver = &check_switchserver($dom,$confname);
     foreach my $img (@{$images}) {
 	$itemcount ++;
@@ -3216,6 +3218,7 @@
             @logintext = ('textcol','bgcol');
         } else {
             %choices = &color_font_choices();
+            $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
         }
         if ($role eq 'login') {
             @images = ('img','logo','domlogo','login');
@@ -3225,7 +3228,6 @@
             @bgs = ('pgbg','tabbg','sidebg'); 
         }
         $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
-	$confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
         foreach my $item (@bgs,@links,@logintext) {
             $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
         }
@@ -3339,13 +3341,15 @@
                         $changes{$role}{'font'} = 1;
                     }
                 }
-                if ($domconfig->{$role}{'fontmenu'} ne '') {
-                    if ($confhash->{$role}{'fontmenu'} ne $domconfig->{$role}{'fontmenu'}) {
-                        $changes{$role}{'fontmenu'} = 1;
-                    }
-                } else {
-                    if ($confhash->{$role}{'fontmenu'}) {
-                        $changes{$role}{'fontmenu'} = 1;
+                if ($role ne 'login') {
+                    if ($domconfig->{$role}{'fontmenu'} ne '') {
+                        if ($confhash->{$role}{'fontmenu'} ne $domconfig->{$role}{'fontmenu'}) {
+                            $changes{$role}{'fontmenu'} = 1;
+                        }
+                    } else {
+                        if ($confhash->{$role}{'fontmenu'}) {
+                            $changes{$role}{'fontmenu'} = 1;
+                        }
                     }
                 }
                 foreach my $item (@bgs) {