More styles
This commit is contained in:
+42
-39
@@ -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\">";
|
||||
print_side_block_start($heading, $width);
|
||||
|
||||
if ($content) {
|
||||
echo "$content";
|
||||
} else {
|
||||
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
|
||||
foreach ($list as $key => $string) {
|
||||
echo "<tr bgcolor=\"$THEME->cellcontent2\">";
|
||||
if ($icons) {
|
||||
echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\">".$icons[$key]."</td>";
|
||||
}
|
||||
echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
if ($footer) {
|
||||
echo "<tr bgcolor=\"$THEME->cellcontent2\">";
|
||||
if ($icons) {
|
||||
echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\"> </td>";
|
||||
}
|
||||
echo "<td class=\"sideblocklinks\"><font size=\"-1\">$footer</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
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>";
|
||||
}
|
||||
if ($content) {
|
||||
echo "<tr>";
|
||||
echo "<td class=\"sideblockmain\" bgcolor=\"$THEME->cellcontent2\">$content</td>";
|
||||
echo "</tr>";
|
||||
} 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\">";
|
||||
if ($icons) {
|
||||
echo "<td valign=\"top\" width=\"16\">".$icons[$key]."</td>";
|
||||
}
|
||||
echo "<td valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
if ($footer) {
|
||||
echo "<tr class=\"sideblockmain\" bgcolor=\"$THEME->cellcontent2\">";
|
||||
if ($icons) {
|
||||
echo "<td valign=\"top\" width=\"16\"> </td>";
|
||||
}
|
||||
echo "<td><font size=\"-1\">$footer</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo "</td></tr>";
|
||||
}
|
||||
echo "<tr>";
|
||||
echo "<td class=\"$class\" bgcolor=\"$THEME->cellcontent2\">";
|
||||
}
|
||||
|
||||
echo "</table></td>";
|
||||
echo "</tr>";
|
||||
function print_side_block_end() {
|
||||
echo "</td></tr>";
|
||||
echo "</table><br \>";
|
||||
}
|
||||
|
||||
|
||||
+11
-14
@@ -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";
|
||||
|
||||
+8
-12
@@ -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";
|
||||
|
||||
+3
-7
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user