From da17a899d74cd734c64686c3bcfd287697097242 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 7 Feb 2005 11:08:37 +0000 Subject: [PATCH] Added class and id to print_table, and id to print_simple_box --- lib/weblib.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 8bd9a29e53..1f680e3f49 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1958,8 +1958,8 @@ function print_continue($link) { * @param string $class ? * @todo Finish documenting this function */ -function print_simple_box($message, $align='', $width='', $color='', $padding=5, $class='generalbox') { - print_simple_box_start($align, $width, $color, $padding, $class); +function print_simple_box($message, $align='', $width='', $color='', $padding=5, $class='generalbox', $id='') { + print_simple_box_start($align, $width, $color, $padding, $class, $id); echo stripslashes_safe($message); print_simple_box_end(); } @@ -1974,7 +1974,7 @@ function print_simple_box($message, $align='', $width='', $color='', $padding=5, * @param string $class ? * @todo Finish documenting this function */ -function print_simple_box_start($align='', $width='', $color='', $padding=5, $class='generalbox') { +function print_simple_box_start($align='', $width='', $color='', $padding=5, $class='generalbox', $id='') { if ($color) { $color = 'bgcolor="'. $color .'"'; @@ -1985,7 +1985,10 @@ function print_simple_box_start($align='', $width='', $color='', $padding=5, $cl if ($width) { $width = 'width="'. $width .'"'; } - echo "". + if ($id) { + $id = 'id="'. $id .'"'; + } + echo "
". "
"; } @@ -2381,9 +2384,15 @@ function print_table($table) { $table->cellspacing = '1'; } + if (empty($table->class)) { + $table->class = 'generaltable'; + } + + $tableid = empty($table->id) ? '' : 'id="'.$table->id.'"'; + print_simple_box_start('center', $table->width, '#ffffff', 0); echo 'cellpadding\" cellspacing=\"$table->cellspacing\" class=\"generaltable\">\n"; + echo " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class\" $tableid>\n"; $countcols = 0; -- 2.39.5