]> git.mjollnir.org Git - moodle.git/commitdiff
More fixes to print_simple_box
authormoodler <moodler>
Fri, 5 Jan 2007 13:17:21 +0000 (13:17 +0000)
committermoodler <moodler>
Fri, 5 Jan 2007 13:17:21 +0000 (13:17 +0000)
lib/weblib.php

index f4c13dd03aac967f9bb83b007c8177a092fe81e7..9bf4b33b0e27b8ca8bc808a6fdd323d42d7edff9 100644 (file)
@@ -2925,21 +2925,25 @@ function print_simple_box_start($align='', $width='', $color='', $padding=5, $cl
     $output = '';
 
     $divclasses = $class.' '.$class.'content';
+    $divstyles  = '';
 
     if ($align) {
         $divclasses .= ' boxalign'.$align;    // Implement alignment using a class
     }
     if ($width) {
-        $width = ' style="width:'.$width.'"';
+        $divstyles  .= ' width:'.$width.';';
     }
     if ($id) {
         $id = ' id="'.$id.'"';
     }
     if ($color) {
-        $color = ' style="background:'.$color.'"';
+        $divstyles  .= ' background:'.$color.';';
+    }
+    if ($divstyles) {
+        $divstyles = ' style="'.$divstyles.'"';
     }
 
-    $output .= '<div'.$color.$width.$id.' class="'.$divclasses.'">';
+    $output .= '<div'.$id.$divstyles.' class="'.$divclasses.'">';
 
     if ($return) {
         return $output;