Permalink
Browse files

More styles

  • Loading branch information...
1 parent 21ba1d7 commit 7541bc3e876bf376d51644c26eaa2ea78cb96511 moodler committed Dec 9, 2002
Showing with 54 additions and 62 deletions.
  1. +32 −29 course/lib.php
  2. +11 −14 course/topics.php
  3. +8 −12 course/weeks.php
  4. +3 −7 lib/moodlelib.php
View
61 course/lib.php
@@ -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 \>";
}
View
25 course/topics.php
@@ -86,10 +86,10 @@
/// 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
@@ -209,24 +209,21 @@
/// 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";
View
20 course/weeks.php
@@ -76,10 +76,9 @@
/// 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
@@ -203,24 +202,21 @@
// 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";
View
10 lib/moodlelib.php
@@ -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";
}
}

0 comments on commit 7541bc3

Please sign in to comment.