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

raeburn raeburn at source.lon-capa.org
Wed May 9 16:17:48 EDT 2012


raeburn		Wed May  9 20:17:48 2012 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Additional (optional) arg for &start_scrollbox: $bgcolor
    - Include bgcolor (if defined) in style attribute for td tag.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1074 loncom/interface/loncommon.pm:1.1075
--- loncom/interface/loncommon.pm:1.1074	Sun May  6 22:09:14 2012
+++ loncom/interface/loncommon.pm	Wed May  9 20:17:47 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1074 2012/05/06 22:09:14 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075 2012/05/09 20:17:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7655,16 +7655,21 @@
 
 
 sub start_scrollbox {
-    my ($outerwidth,$width,$height,$id)=@_;
+    my ($outerwidth,$width,$height,$id,$bgcolor)=@_;
     unless ($outerwidth) { $outerwidth='520px'; }
     unless ($width) { $width='500px'; }
     unless ($height) { $height='200px'; }
-    my ($table_id,$div_id);
+    my ($table_id,$div_id,$tdcol);
     if ($id ne '') {
         $table_id = " id='table_$id'";
         $div_id = " id='div_$id'";
     }
-    return "<table style='width: $outerwidth; border: 1px solid none;'$table_id><tr><td style='width: $width;' bgcolor='#FFFFFF'><div style='overflow:auto; width:$width; height: $height;'$div_id>";
+    if ($bgcolor ne '') {
+        $tdcol = "background-color: $bgcolor;";
+    }
+    return <<"END";
+<table style="width: $outerwidth; border: 1px solid none;"$table_id><tr><td style="width: $width;$tdcol"><div style="overflow:auto; width:$width; height: $height;"$div_id>
+END
 }
 
 sub end_scrollbox {




More information about the LON-CAPA-cvs mailing list