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

raeburn raeburn at source.lon-capa.org
Tue Dec 11 20:57:37 EST 2012


raeburn		Wed Dec 12 01:57:37 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport  1.174,  1.176.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.8 loncom/interface/domainprefs.pm:1.160.6.9
--- loncom/interface/domainprefs.pm:1.160.6.8	Tue Oct  2 19:38:00 2012
+++ loncom/interface/domainprefs.pm	Wed Dec 12 01:57:37 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.8 2012/10/02 19:38:00 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.9 2012/12/12 01:57:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1163,13 +1163,12 @@
     } else {
         $datatable .= '<td> </td>';
     }
-    my $fontlink = &color_pick($phase,$role,'font',$choices->{'font'},$designs->{'font'});
+    my $current_color = $designs->{'font'} ? $designs->{'font'} : $defaults->{'font'};
+
     $datatable .= '<td><span class="LC_nobreak">'.
-                  '<input type="text" size="10" name="'.$role.'_font"'.
-                  ' value="'.$designs->{'font'}.'" /> '.$fontlink.
-                  ' <span id="css_'.$role.'_font" style="background-color: '.
-                  $designs->{'font'}.';">   </span>'.
-                  '</span></td></tr>';
+                  '<input type="text" class="colorchooser" size="10" name="'.$role.'_font"'.
+                  ' value="'.$current_color.'" /> '.
+                  ' </td></tr>';
     unless ($role eq 'login') { 
         $datatable .= '<tr'.$css_class.'>'.
                       '<td>'.$choices->{'fontmenu'}.'</td>';
@@ -1178,13 +1177,13 @@
         } else {
             $datatable .= '<td> </td>';
         }
-        $fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'});
+        $current_color = $designs->{'fontmenu'} ?
+            $designs->{'fontmenu'} : $defaults->{'fontmenu'};
         $datatable .= '<td><span class="LC_nobreak">'.
-                      '<input type="text" size="10" name="'.$role.'_fontmenu"'.
-                      ' value="'.$designs->{'fontmenu'}.'" /> '.$fontlink.
-                      ' <span id="css_'.$role.'_fontmenu" style="background-color: '.
-                      $designs->{'fontmenu'}.';">   </span>'.
-                      '</span></td></tr>';
+                      '<input class="colorchooser" type="text" size="10" name="'
+                      .$role.'_fontmenu"'.
+                      ' value="'.$current_color.'" /> '.
+                      ' </td></tr>';
     }
     my $switchserver = &check_switchserver($dom,$confname);
     foreach my $img (@{$images}) {
@@ -1312,12 +1311,12 @@
     $datatable .= '<td class="LC_right_item">'.
                   '<table border="0"><tr>';
     foreach my $item (@{$bgs}) {
-        my $link = &color_pick($phase,$role,$item,$choices->{$item},$designs->{'bgs'}{$item});
-        $datatable .= '<td align="center">'.$link;
+        $datatable .= '<td align="center">';
+        my $color = $designs->{'bgs'}{$item} ? $designs->{'bgs'}{$item} : $defaults->{'bgs'}{$item};
         if ($designs->{'bgs'}{$item}) {
-            $datatable .= ' <span id="css_'.$role.'_'.$item.'" style="background-color: '.$designs->{'bgs'}{$item}.';">   </span>';
+            $datatable .= ' ';
         }
-        $datatable .= '<br /><input type="text" size="8" name="'.$role.'_'.$item.'" value="'.$designs->{'bgs'}{$item}.
+        $datatable .= '<br /><input type="text" class="colorchooser" size="8" name="'.$role.'_'.$item.'" value="'.$color.
                       '" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></td>';
     }
     $datatable .= '</tr></table></td></tr>';
@@ -1339,14 +1338,15 @@
     $datatable .= '<td class="LC_right_item">'.
                   '<table border="0"><tr>';
     foreach my $item (@{$links}) {
-        $datatable .= '<td align="center">'."\n".
-                      &color_pick($phase,$role,$item,$choices->{$item},
-                                  $designs->{'links'}{$item});
+        my $color = $designs->{'link'}{$item} ? $designs->{'link'}{$item} : $defaults->{'links'}{$item};
+        $datatable .= '<td align="center">'."\n";
+
         if ($designs->{'links'}{$item}) {
-            $datatable.=' <span id="css_'.$role.'_'.$item.'" style="background-color: '.$designs->{'links'}{$item}.';">   </span>';
+            $datatable.=' ';
         }
-        $datatable .= '<br /><input type="text" size="8" name="'.$role.'_'.$item.'" value="'.$designs->{'links'}{$item}.
+        $datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" value="'.$color.
                       '" /></td>';
+
     }
     $$rowtotal += $itemcount;
     return $datatable;




More information about the LON-CAPA-cvs mailing list