From 7541bc3e876bf376d51644c26eaa2ea78cb96511 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 9 Dec 2002 13:36:55 +0000 Subject: [PATCH] More styles --- course/lib.php | 81 ++++++++++++++++++++++++----------------------- course/topics.php | 25 +++++++-------- course/weeks.php | 20 +++++------- lib/moodlelib.php | 10 ++---- 4 files changed, 64 insertions(+), 72 deletions(-) diff --git a/course/lib.php b/course/lib.php index f019bb04981..9bee070e1f0 100644 --- a/course/lib.php +++ b/course/lib.php @@ -527,17 +527,13 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, echo "
\n\n"; } -function print_heading_block($heading, $width="100%") { +function print_heading_block($heading, $width="100%", $class="headingblock") { global $THEME; - echo ""; - echo ""; - 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 ""; - echo ""; +function print_side_block_end() { + 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 ""; + } + echo ""; + echo ""; + } + if ($footer) { + echo "cellcontent2\">"; + if ($icons) { + echo ""; + } + echo ""; + echo ""; + } + echo "
".$icons[$key]."$string
 $footer
"; + } + + 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 ""; echo ""; } - if ($content) { - echo ""; - echo ""; - echo ""; - } else { - echo ""; - } + echo ""; + echo "
cellheading\">$heading
cellcontent2\">$content
cellcontent2\">"; - echo ""; - foreach ($list as $key => $string) { - echo "cellcontent2\">"; - if ($icons) { - echo ""; - } - echo ""; - echo ""; - } - if ($footer) { - echo "cellcontent2\">"; - if ($icons) { - echo ""; - } - echo ""; - echo ""; - } - echo "
".$icons[$key]."$string
 $footer
"; - echo "
cellcontent2\">"; +} - 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"; } }