]> git.mjollnir.org Git - moodle.git/commitdiff
More styles
authormoodler <moodler>
Mon, 9 Dec 2002 13:36:55 +0000 (13:36 +0000)
committermoodler <moodler>
Mon, 9 Dec 2002 13:36:55 +0000 (13:36 +0000)
course/lib.php
course/topics.php
course/weeks.php
lib/moodlelib.php

index f019bb04981c9fb1e411d328e5244870adf19280..9bee070e1f030bd5b5e1a97f6cbcc2e1999884e4 100644 (file)
@@ -527,17 +527,13 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
     echo "</TD></TR></TABLE><BR>\n\n";
 }
 
-function print_heading_block($heading, $width="100%") {
+function print_heading_block($heading, $width="100%", $class="headingblock") {
     global $THEME;
 
-    echo "<table width=\"$width\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
-    echo "<tr>";
-    echo "<td bgcolor=\"$THEME->borders\">";
-    echo "<table class=\"headingblockouter\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">";
-    echo "<tr><td bgcolor=\"$THEME->cellheading\" class=\"headingblockinner\">";
+    echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">";
+    echo "<tr><td bgcolor=\"$THEME->cellheading\" class=\"$class\">";
     echo stripslashes($heading);
     echo "</td></tr></table>";
-    echo "</td></tr></table>";
 }
 
 function print_side_block($heading="", $content="", $list=NULL, $icons=NULL, $footer="", $width=180) {
@@ -546,44 +542,51 @@ function print_side_block($heading="", $content="", $list=NULL, $icons=NULL, $fo
     
     global $THEME;
 
-    echo "<table width=\"$width\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
-    echo "<tr>";
-    echo "<td bgcolor=\"$THEME->borders\">";
-    echo "<table class=\"sideblock\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">";
-    if ($heading) {
-        echo "<tr>";
-        echo "<td class=\"sideblockheading\" bgcolor=\"$THEME->cellheading\">$heading</td>";
-        echo "</tr>";
-    }
+    print_side_block_start($heading, $width);
+
     if ($content) {
-        echo "<tr>";
-        echo "<td class=\"sideblockmain\" bgcolor=\"$THEME->cellcontent2\">$content</td>";
-        echo "</tr>";
+        echo "$content";
     } else {
-        echo "<tr><td class=\"sideblocklinks\" bgcolor=\"$THEME->cellcontent2\">";
         echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
         foreach ($list as $key => $string) {
-            echo "<tr class=\"sideblockmain\" bgcolor=\"$THEME->cellcontent2\">";
+            echo "<tr bgcolor=\"$THEME->cellcontent2\">";
             if ($icons) {
-                echo "<td valign=\"top\" width=\"16\">".$icons[$key]."</td>";
+                echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\">".$icons[$key]."</td>";
             }
-            echo "<td valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
+            echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
             echo "</tr>";
         }
         if ($footer) {
-            echo "<tr class=\"sideblockmain\" bgcolor=\"$THEME->cellcontent2\">";
+            echo "<tr bgcolor=\"$THEME->cellcontent2\">";
             if ($icons) {
-                echo "<td valign=\"top\" width=\"16\">&nbsp;</td>";
+                echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\">&nbsp;</td>";
             }
-            echo "<td><font size=\"-1\">$footer</td>";
+            echo "<td class=\"sideblocklinks\"><font size=\"-1\">$footer</td>";
             echo "</tr>";
         }
         echo "</table>";
-        echo "</td></tr>";
     }
 
-    echo "</table></td>";
-    echo "</tr>";
+    print_side_block_end();
+}
+
+function print_side_block_start($heading="", $width=180, $class="sideblockmain") {
+// Starts a nice side block with an optional header.
+    
+    global $THEME;
+
+    echo "<table class=\"sideblock\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">";
+    if ($heading) {
+        echo "<tr>";
+        echo "<td class=\"sideblockheading\" bgcolor=\"$THEME->cellheading\">$heading</td>";
+        echo "</tr>";
+    }
+    echo "<tr>";
+    echo "<td class=\"$class\" bgcolor=\"$THEME->cellcontent2\">";
+}
+
+function print_side_block_end() {
+    echo "</td></tr>";
     echo "</table><br \>";
 }
 
index a42c4b20821db6390e9858bdc198ee063782daf9..967993039a933c965194741fb504d416609d310d 100644 (file)
 /// Start main column
     echo "</TD><TD WIDTH=\"*\">";
 
-    print_heading_block(get_string("topicoutline"));
+    print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock");
+    print_spacer(8, 1, true);
 
-
-    echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
+    echo "<table class=\"weeklyoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
 
 /// Print Section 0 
 
         /// Print all the news items.
 
         if ($news) {
-            print_heading_block(get_string("latestnews"));
-            print_simple_box_start("CENTER", "100%", $THEME->cellcontent, 3, 0);
-            echo "<FONT SIZE=1>";
+            print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
+            echo "<FONT SIZE=\"-1\">";
             forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
             echo "</FONT>";
-            print_simple_box_end();
-            echo "<BR>";
+            print_side_block_end();
         }
         
-        /// Print all the recent activity
+        // Print all the recent activity
         if ($course->showrecent) {
-            print_heading_block(get_string("recentactivity"));
-            print_simple_box_start("CENTER", "100%", $THEME->cellcontent, 3, 0);
+            print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
             print_recent_activity($course);
-            print_simple_box_end();
+            print_side_block_end();
         }
-
-        echo "<BR><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
+    
+        print_spacer(1, 120, true);
     }
 
     echo "</TD></TR></TABLE>\n";
index fed91259880dec362eeabdaa362abcd1ebfcc7ca..cdc840a909d3eb28adea138e9fd7c7726eddc860 100644 (file)
 
 /// Start main column
     echo "</TD><TD WIDTH=\"*\">";
-    print_heading_block(get_string("weeklyoutline"));
-
-    echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=100%>";
+    print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
 
+    echo "<table class=\"weeklyoutline\" border=\"0\" cellpadding=\"8\" cellspacing=\"0\" width=\"100%\">";
 
 /// Print Week 0 with general activities
 
         // Print all the news items.
 
         if ($news) {
-            print_heading_block(get_string("latestnews"));
-            print_simple_box_start("CENTER", "100%", $THEME->cellcontent, 3, 0);
-            echo "<FONT SIZE=1>";
+            print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
+            echo "<FONT SIZE=\"-1\">";
             forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
             echo "</FONT>";
-            print_simple_box_end();
-            echo "<BR \>";
+            print_side_block_end();
         }
         
         // Print all the recent activity
         if ($course->showrecent) {
-            print_heading_block(get_string("recentactivity"));
-            print_simple_box_start("CENTER", "100%", $THEME->cellcontent, 3, 0);
+            print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
             print_recent_activity($course);
-            print_simple_box_end();
+            print_side_block_end();
         }
     
-        echo "<BR \><IMG SRC=\"../pix/spacer.gif\" WIDTH=210 HEIGHT=1>";
+        print_spacer(1, 120, true);
     }
 
     echo "</TD></TR></TABLE>\n";
index 5ade77c1f50e556a7b423052116829448c9a032c..18ee50094f530dbe486a76553d3655e17fa8a71b 100644 (file)
@@ -157,16 +157,12 @@ function print_simple_box_start($align="", $width="", $color="#FFFFFF", $padding
     }
     if ($width) {
         $tablewidth = "WIDTH=\"$width\"";
-        $innertablewidth = "WIDTH=\"100%\"";
     }
-    echo "<TABLE $tablealign $tablewidth BORDER=0 CELLPADDING=\"$border\" CELLSPACING=0>";
-    echo "<TR><TD BGCOLOR=\"$THEME->borders\">\n";
-    echo "<TABLE $innertablewidth BORDER=0 CELLPADDING=\"$padding\" CELLSPACING=0><TR><TD BGCOLOR=\"$color\">";
+    echo "<table $tablealign $tablewidth class=\"generalbox\" border=\"0\" cellpadding=\"$padding\" cellspacing=\"0\"><tr><td bgcolor=\"$color\">";
 }
 
 function print_simple_box_end() {
-    echo "</TD></TR></TABLE>";
-    echo "</TD></TR></TABLE>";
+    echo "</td></tr></table>";
 }
 
 function print_single_button($link, $options, $label="OK") {
@@ -183,7 +179,7 @@ function print_spacer($height=1, $width=1, $br=true) {
     global $CFG;
     echo "<IMG HEIGHT=\"$height\" WIDTH=\"$width\" SRC=\"$CFG->wwwroot/pix/spacer.gif\" ALT=\"\">";
     if ($br) {
-        echo "<BR>\n";
+        echo "<BR \>\n";
     }
 }