From: moodler Date: Mon, 9 Dec 2002 13:36:55 +0000 (+0000) Subject: More styles X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7541bc3e876bf376d51644c26eaa2ea78cb96511;p=moodle.git More styles --- diff --git a/course/lib.php b/course/lib.php index f019bb0498..9bee070e1f 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 ""; + 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 "
borders\">"; - echo ""; - if ($heading) { - echo ""; - echo ""; - echo ""; - } + print_side_block_start($heading, $width); + if ($content) { - echo ""; - echo ""; - echo ""; + echo "$content"; } else { - echo ""; } - echo "
cellheading\">$heading
cellcontent2\">$content
cellcontent2\">"; echo ""; foreach ($list as $key => $string) { - echo "cellcontent2\">"; + echo "cellcontent2\">"; if ($icons) { - echo ""; + echo ""; } - echo ""; + echo ""; echo ""; } if ($footer) { - echo "cellcontent2\">"; + echo "cellcontent2\">"; if ($icons) { - echo ""; + echo ""; } - echo ""; + echo ""; echo ""; } echo "
".$icons[$key]."".$icons[$key]."$string$string
  $footer$footer
"; - echo "
"; + if ($heading) { + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; echo "
cellheading\">$heading
cellcontent2\">"; +} + +function print_side_block_end() { + echo "

"; } diff --git a/course/topics.php b/course/topics.php index a42c4b2082..967993039a 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 fed9125988..cdc840a909 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 5ade77c1f5..18ee50094f 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"; } }