";
- echo "borders\">";
- echo "";
- echo "cellheading\" class=\"headingblockinner\">";
+ echo "";
+ echo "| cellheading\" class=\"$class\">";
echo stripslashes($heading);
echo " | ";
- echo " | ";
}
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 "";
- echo "";
- echo "borders\">";
- echo "";
+ print_side_block_start($heading, $width);
+
+ if ($content) {
+ echo "$content";
+ } else {
+ echo "";
+ foreach ($list as $key => $string) {
+ echo "cellcontent2\">";
+ if ($icons) {
+ echo "| ".$icons[$key]." | ";
+ }
+ echo "$string | ";
+ echo " ";
+ }
+ if ($footer) {
+ echo "cellcontent2\">";
+ if ($icons) {
+ echo "| | ";
+ }
+ echo "$footer | ";
+ echo " ";
+ }
+ echo " ";
+ }
+
+ 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 "";
if ($heading) {
echo "";
echo "| cellheading\">$heading | ";
echo " ";
}
- if ($content) {
- echo "";
- echo "| cellcontent2\">$content | ";
- echo " ";
- } else {
- echo "cellcontent2\">";
- echo "";
- foreach ($list as $key => $string) {
- echo "cellcontent2\">";
- if ($icons) {
- echo "| ".$icons[$key]." | ";
- }
- echo "$string | ";
- echo " ";
- }
- if ($footer) {
- echo "cellcontent2\">";
- if ($icons) {
- echo "| | ";
- }
- echo "$footer | ";
- echo " ";
- }
- echo " ";
- echo " | ";
- }
+ echo "";
+ echo "| cellcontent2\">";
+}
- echo " | ";
- echo "";
+function print_side_block_end() {
+ echo "";
echo " ";
}
diff --git a/course/topics.php b/course/topics.php
index a42c4b20821..967993039a9 100644
--- a/course/topics.php
+++ b/course/topics.php
@@ -86,10 +86,10 @@
/// Start main column
echo " | ";
- print_heading_block(get_string("topicoutline"));
+ print_heading_block(get_string("topicoutline"), "100%", "outlineheadingblock");
+ print_spacer(8, 1, true);
-
- echo "";
+ echo "";
/// 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 "";
+ print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
+ echo "";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "";
- print_simple_box_end();
- echo " ";
+ 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 "
";
+
+ print_spacer(1, 120, true);
}
echo " \n";
diff --git a/course/weeks.php b/course/weeks.php
index fed91259880..cdc840a909d 100644
--- a/course/weeks.php
+++ b/course/weeks.php
@@ -76,10 +76,9 @@
/// Start main column
echo "";
- print_heading_block(get_string("weeklyoutline"));
-
- echo "";
+ print_heading_block(get_string("weeklyoutline"), "100%", "outlineheadingblock");
+ echo "";
/// 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 "";
+ print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
+ echo "";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
echo "";
- print_simple_box_end();
- echo " ";
+ 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 "
";
+ print_spacer(1, 120, true);
}
echo " \n";
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 5ade77c1f50..18ee50094f5 100644
--- a/lib/moodlelib.php
+++ b/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 "";
- echo "borders\">\n";
- echo "";
+ echo "| ";
}
function print_simple_box_end() {
- echo " | ";
- echo " | ";
+ echo " | ";
}
function print_single_button($link, $options, $label="OK") {
@@ -183,7 +179,7 @@ function print_spacer($height=1, $width=1, $br=true) {
global $CFG;
echo " wwwroot/pix/spacer.gif\" ALT=\"\">";
if ($br) {
- echo " \n";
+ echo " \n";
}
}
| | |