From 30c9e6947dba639008e6ed1543a2e0e85af2893c Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 10 Apr 2006 01:39:38 +0000 Subject: [PATCH] Reverting changes to print_simple_box for now until the new div can be rolled out without problems. See bug 4943 --- lib/weblib.php | 48 +++++++++++------------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 27da4fa2d2..4bfdf00dd2 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2518,67 +2518,41 @@ function print_simple_box($message, $align='', $width='', $color='', $padding=5, } /** - * Print the top portion of a standard themed box. - * To improve accessibility, the box is now a DIV, not a TABLE. - * If the box is left aligned and width is not specified the box will shrink - * to fit - as per the 1.5 table behaviour. - * If alignment and width are not specified, the box will be centred and given - * a width of 30em, based on usability studies - * {@link http://www.maxdesign.com.au/presentation/em/ Ideal line length for content}. - * Text will be left aligned - the behaviour has changed, but will hopefully look OK. + * Print the top portion of a standard themed box using a TABLE. Yes, we know. + * See bug 4943 for details on some accessibility work regarding this that didn't make it into 1.6. * * @param string $align string, alignment of the box, not the text (default center, left, right). * @param string $width string, width of the box, including % units, for example '100%'. * @param string $color string, background colour of the box, for example '#eee'. * @param int $padding integer, padding in pixels, specified without units. * @param string $class string, space-separated class names. - * @todo Finish documenting this function */ function print_simple_box_start($align='', $width='', $color='', $padding=5, $class='generalbox', $id='') { - //Accessibility: print_simple_box replaced with nested
s. - $style_out = ''; - $style_in = ''; - if ($padding) { - $style_in .= 'padding:'. $padding .'px; '; - } - if ($color) { - $style_out .= 'background-color:'. $color .'; '; + $color = 'bgcolor="'. $color .'"'; } - if (!$align || 'center' == $align) { - if (! $width) { - $style_out .= 'width:30em; '; - } - $style_out .= 'margin-left:auto; margin-right:auto; '; - } - elseif ($align && 'left' == $align) { - $style_out .= 'float:left; '; - } - else { - $style_out .= 'float:right; '; + if ($align) { + $align = 'align="'. $align .'"'; } if ($width) { - //Note, width units provided. - $style_out .= 'width:'. $width .'; '; + $width = 'width="'. $width .'"'; } if ($id) { $id = 'id="'. $id .'"'; - } - echo "\n
\n"; - global $CFG; - if ($CFG->debug > 7) { - echo "\n"; - } + } + echo "
". + "
"; } /** * Print the end portion of a standard themed box. */ function print_simple_box_end() { - echo "
\n"; + echo '
'; } + /** * Print a self contained form with a single submit button. * -- 2.39.5